C# Класс FSO.Files.Utils.IoBuffer

IOBuffer is a very basic wrapper over System.BinaryReader that inherits from IDisposable.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ByteOrder ByteOrder

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

Метод Описание
Dispose ( ) : void
FromBytes ( byte bytes ) : IoBuffer

Creates a new IOBuffer instance from a byte array.

FromBytes ( byte bytes, ByteOrder order ) : IoBuffer

Creates a new IOBuffer instance from a byte array, using a specified byte order.

FromStream ( Stream stream ) : IoBuffer

Creates a new IOBuffer instance from a stream.

FromStream ( Stream stream, ByteOrder order ) : IoBuffer

Creates a new IOBuffer instance from a stream, using a specified byte order.

IoBuffer ( Stream stream ) : System

Creates a new IOBuffer instance from a stream.

Mark ( ) : void
ReadByte ( ) : byte

Reads a byte from the current stream.

ReadBytes ( int num ) : byte[]

Reads a number of bytes from the current stream.

ReadBytes ( uint num ) : byte[]

Reads a number of bytes from the current stream.

ReadCString ( int num ) : string

Reads a number of ASCII characters from the current stream.

ReadCString ( int num, bool trimNull ) : string

Reads a number of ASCII characters from the current stream.

ReadInt16 ( ) : short

Reads a 16bit integer from the current stream.

ReadInt32 ( ) : int

Reads a 32bit integer from the current stream.

ReadLongPascalString ( ) : string

Reads a pascal string from the current stream, which is prefixed by a 16bit short.

ReadNullTerminatedString ( ) : string

Reads a C string from the current stream.

ReadNullTerminatedUTF8 ( ) : string
ReadPascalString ( ) : string

Reads a pascal string from the current stream, prefixed by a byte.

ReadUInt16 ( ) : ushort

Reads an unsigned 16bit integer from the current stream.

ReadUInt32 ( ) : uint

Reads an unsigned 32bit integer from the current stream.

ReadVarLen ( ) : uint

Reads a variable length unsigned integer from the current stream.

ReadVariableLengthPascalString ( ) : string

Reads a pascal string from the current stream.

Seek ( SeekOrigin origin, long offset ) : void

Seeks in the current stream.

SeekFromMark ( long numBytes ) : void

Seeks in the current stream from the current mark plus the number of bytes.

Skip ( long numBytes ) : void

Skips a number of bytes in the current stream, starting from the current position.

Приватные методы

Метод Описание
ReadFloat ( ) : float

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

Dispose() публичный метод

public Dispose ( ) : void
Результат void

FromBytes() публичный статический метод

Creates a new IOBuffer instance from a byte array.
public static FromBytes ( byte bytes ) : IoBuffer
bytes byte The byte array to use.
Результат IoBuffer

FromBytes() публичный статический метод

Creates a new IOBuffer instance from a byte array, using a specified byte order.
public static FromBytes ( byte bytes, ByteOrder order ) : IoBuffer
bytes byte The byte array to use.
order ByteOrder Byte order to use.
Результат IoBuffer

FromStream() публичный статический метод

Creates a new IOBuffer instance from a stream.
public static FromStream ( Stream stream ) : IoBuffer
stream Stream A stream.
Результат IoBuffer

FromStream() публичный статический метод

Creates a new IOBuffer instance from a stream, using a specified byte order.
public static FromStream ( Stream stream, ByteOrder order ) : IoBuffer
stream Stream A stream.
order ByteOrder Byte order to use.
Результат IoBuffer

IoBuffer() публичный метод

Creates a new IOBuffer instance from a stream.
public IoBuffer ( Stream stream ) : System
stream Stream
Результат System

Mark() публичный метод

public Mark ( ) : void
Результат void

ReadByte() публичный метод

Reads a byte from the current stream.
public ReadByte ( ) : byte
Результат byte

ReadBytes() публичный метод

Reads a number of bytes from the current stream.
public ReadBytes ( int num ) : byte[]
num int Number of bytes to read.
Результат byte[]

ReadBytes() публичный метод

Reads a number of bytes from the current stream.
public ReadBytes ( uint num ) : byte[]
num uint Number of bytes to read.
Результат byte[]

ReadCString() публичный метод

Reads a number of ASCII characters from the current stream.
public ReadCString ( int num ) : string
num int The number of characters to read.
Результат string

ReadCString() публичный метод

Reads a number of ASCII characters from the current stream.
public ReadCString ( int num, bool trimNull ) : string
num int The number of characters to read.
trimNull bool Trim the trailing 0?
Результат string

ReadInt16() публичный метод

Reads a 16bit integer from the current stream.
public ReadInt16 ( ) : short
Результат short

ReadInt32() публичный метод

Reads a 32bit integer from the current stream.
public ReadInt32 ( ) : int
Результат int

ReadLongPascalString() публичный метод

Reads a pascal string from the current stream, which is prefixed by a 16bit short.
public ReadLongPascalString ( ) : string
Результат string

ReadNullTerminatedString() публичный метод

Reads a C string from the current stream.
public ReadNullTerminatedString ( ) : string
Результат string

ReadNullTerminatedUTF8() публичный метод

public ReadNullTerminatedUTF8 ( ) : string
Результат string

ReadPascalString() публичный метод

Reads a pascal string from the current stream, prefixed by a byte.
public ReadPascalString ( ) : string
Результат string

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

Reads an unsigned 16bit integer from the current stream.
public ReadUInt16 ( ) : ushort
Результат ushort

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

Reads an unsigned 32bit integer from the current stream.
public ReadUInt32 ( ) : uint
Результат uint

ReadVarLen() публичный метод

Reads a variable length unsigned integer from the current stream.
public ReadVarLen ( ) : uint
Результат uint

ReadVariableLengthPascalString() публичный метод

Reads a pascal string from the current stream.
public ReadVariableLengthPascalString ( ) : string
Результат string

Seek() публичный метод

Seeks in the current stream.
public Seek ( SeekOrigin origin, long offset ) : void
origin SeekOrigin Where to start from.
offset long The offset to seek to.
Результат void

SeekFromMark() публичный метод

Seeks in the current stream from the current mark plus the number of bytes.
public SeekFromMark ( long numBytes ) : void
numBytes long The number of bytes to add to the offset (mark).
Результат void

Skip() публичный метод

Skips a number of bytes in the current stream, starting from the current position.
public Skip ( long numBytes ) : void
numBytes long Number of bytes to skip.
Результат void

Описание свойств

ByteOrder публичное свойство

public ByteOrder ByteOrder
Результат ByteOrder