C# Class CrystalMpq.MpqFileStream

Exposes Stream with the data contained in an MpqFile.
Inheritance: Stream
Mostra file Open project: sgraf812/crystalmpq Class Usage Examples

Public Methods

Method Description
Close ( ) : void
Flush ( ) : void
Read ( byte buffer, int offset, int count ) : int

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

ReadByte ( ) : int
Seek ( long offset, SeekOrigin origin ) : long
SetLength ( long value ) : void
Write ( byte buffer, int offset, int count ) : void

Private Methods

Method Description
ApplyBsd0Patch ( PatchInfoHeader &patchInfoHeader, PatchHeader &patchHeader, uint patchLength, byte originalData ) : byte[]
ApplyCopyPatch ( PatchInfoHeader &patchInfoHeader, PatchHeader &patchHeader, uint patchLength, byte originalData ) : byte[]
ApplyPatch ( PatchInfoHeader patchInfoHeader, Stream baseStream ) : byte[]
MpqFileStream ( MpqFile file, Stream baseStream = null ) : System.Diagnostics
Read ( byte buffer, int count ) : int
ReadBlock ( int block ) : void
ReadBlockOffsets ( MpqArchive archive, uint hash, long offset, int count ) : uint[]
ReadPatchInfoHeader ( MpqArchive archive, long offset ) : PatchInfoHeader
TestPatchHeader ( MpqArchive archive, long offset ) : bool
UnpackRle ( uint compressedLength ) : byte[]
UpdateBuffer ( ) : void

Method Details

Close() public final method

public final Close ( ) : void
return void

Flush() public final method

public final Flush ( ) : void
return void

Read() public final method

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
public final Read ( byte buffer, int offset, int count ) : int
buffer byte An array of bytes. When this method returns, the buffer contains the specified byte array with the values between and ( + - 1) replaced by the bytes read from the current source.
offset int The zero-based byte offset in at which to begin storing the data read from the current stream.
count int The maximum number of bytes to be read from the current stream.
return int

ReadByte() public final method

public final ReadByte ( ) : int
return int

Seek() public final method

public final Seek ( long offset, SeekOrigin origin ) : long
offset long
origin SeekOrigin
return long

SetLength() public final method

public final SetLength ( long value ) : void
value long
return void

Write() public final method

public final Write ( byte buffer, int offset, int count ) : void
buffer byte
offset int
count int
return void