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.
Show file Open project: garyjohnson/wpnest Class Usage Examples

Public Methods

Method 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 method

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

ReadContentsFrom() public method

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

ReadUInt16() public method

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

ReadUInt32() public method

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

SkipBytes() public method

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

WriteContentsTo() public method

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

WriteUInt16() public method

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

WriteUInt32() public method

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