C# Class System.IO.Compression.ByteBuffer

A byte[] array that also stores a current offset. Useful for reading/writing headers, ensuring the offset is updated correctly.
Afficher le fichier Open project: garyjohnson/wpnest Class Usage Examples

Méthodes publiques

Méthode Description
ByteBuffer ( int size )

Initializes a new instance of the ByteBuffer type.

ReadContentsFrom ( Stream reader ) : int

Fills the buffer from the stream.

ReadUInt16 ( ) : ushort

Reads a 16-bit unsigned integer from the buffer.

ReadUInt32 ( ) : uint

Reads a 32-bit unsigned integer from the buffer.

SkipBytes ( int count ) : void

Skips ahead a count of bytes.

WriteContentsTo ( Stream writer ) : void

Writes the contents of the buffer to a stream.

WriteUInt16 ( ushort value ) : void

Writes an unsigned short value to the buffer.

WriteUInt32 ( uint value ) : void

Write an unsigned integer to the buffer.

Method Details

ByteBuffer() public méthode

Initializes a new instance of the ByteBuffer type.
public ByteBuffer ( int size )
size int The buffer size.

ReadContentsFrom() public méthode

Fills the buffer from the stream.
public ReadContentsFrom ( Stream reader ) : int
reader Stream The stream to read from.
Résultat int

ReadUInt16() public méthode

Reads a 16-bit unsigned integer from the buffer.
public ReadUInt16 ( ) : ushort
Résultat ushort

ReadUInt32() public méthode

Reads a 32-bit unsigned integer from the buffer.
public ReadUInt32 ( ) : uint
Résultat uint

SkipBytes() public méthode

Skips ahead a count of bytes.
public SkipBytes ( int count ) : void
count int The number of bytes to skip.
Résultat void

WriteContentsTo() public méthode

Writes the contents of the buffer to a stream.
public WriteContentsTo ( Stream writer ) : void
writer Stream The stream to write to.
Résultat void

WriteUInt16() public méthode

Writes an unsigned short value to the buffer.
public WriteUInt16 ( ushort value ) : void
value ushort The value to write.
Résultat void

WriteUInt32() public méthode

Write an unsigned integer to the buffer.
public WriteUInt32 ( uint value ) : void
value uint The value to write.
Résultat void