C# Класс System.IO.Compression.ByteBuffer

A byte[] array that also stores a current offset. Useful for reading/writing headers, ensuring the offset is updated correctly.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

ByteBuffer() публичный Метод

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

ReadContentsFrom() публичный Метод

Fills the buffer from the stream.
public ReadContentsFrom ( Stream reader ) : int
reader Stream The stream to read from.
Результат int

ReadUInt16() публичный Метод

Reads a 16-bit unsigned integer from the buffer.
public ReadUInt16 ( ) : ushort
Результат ushort

ReadUInt32() публичный Метод

Reads a 32-bit unsigned integer from the buffer.
public ReadUInt32 ( ) : uint
Результат uint

SkipBytes() публичный Метод

Skips ahead a count of bytes.
public SkipBytes ( int count ) : void
count int The number of bytes to skip.
Результат void

WriteContentsTo() публичный Метод

Writes the contents of the buffer to a stream.
public WriteContentsTo ( Stream writer ) : void
writer Stream The stream to write to.
Результат void

WriteUInt16() публичный Метод

Writes an unsigned short value to the buffer.
public WriteUInt16 ( ushort value ) : void
value ushort The value to write.
Результат void

WriteUInt32() публичный Метод

Write an unsigned integer to the buffer.
public WriteUInt32 ( uint value ) : void
value uint The value to write.
Результат void