C# Class FSO.Files.Utils.IoBuffer

IOBuffer is a very basic wrapper over System.BinaryReader that inherits from IDisposable.
Inheritance: IDisposable
Mostrar archivo Open project: RHY3756547/FreeSO Class Usage Examples

Public Properties

Property Type Description
ByteOrder ByteOrder

Public Methods

Method Description
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.

Private Methods

Method Description
ReadFloat ( ) : float

Method Details

Dispose() public method

public Dispose ( ) : void
return void

FromBytes() public static method

Creates a new IOBuffer instance from a byte array.
public static FromBytes ( byte bytes ) : IoBuffer
bytes byte The byte array to use.
return IoBuffer

FromBytes() public static method

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.
return IoBuffer

FromStream() public static method

Creates a new IOBuffer instance from a stream.
public static FromStream ( Stream stream ) : IoBuffer
stream Stream A stream.
return IoBuffer

FromStream() public static method

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.
return IoBuffer

IoBuffer() public method

Creates a new IOBuffer instance from a stream.
public IoBuffer ( Stream stream ) : System
stream Stream
return System

Mark() public method

public Mark ( ) : void
return void

ReadByte() public method

Reads a byte from the current stream.
public ReadByte ( ) : byte
return byte

ReadBytes() public method

Reads a number of bytes from the current stream.
public ReadBytes ( int num ) : byte[]
num int Number of bytes to read.
return byte[]

ReadBytes() public method

Reads a number of bytes from the current stream.
public ReadBytes ( uint num ) : byte[]
num uint Number of bytes to read.
return byte[]

ReadCString() public method

Reads a number of ASCII characters from the current stream.
public ReadCString ( int num ) : string
num int The number of characters to read.
return string

ReadCString() public method

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?
return string

ReadInt16() public method

Reads a 16bit integer from the current stream.
public ReadInt16 ( ) : short
return short

ReadInt32() public method

Reads a 32bit integer from the current stream.
public ReadInt32 ( ) : int
return int

ReadLongPascalString() public method

Reads a pascal string from the current stream, which is prefixed by a 16bit short.
public ReadLongPascalString ( ) : string
return string

ReadNullTerminatedString() public method

Reads a C string from the current stream.
public ReadNullTerminatedString ( ) : string
return string

ReadNullTerminatedUTF8() public method

public ReadNullTerminatedUTF8 ( ) : string
return string

ReadPascalString() public method

Reads a pascal string from the current stream, prefixed by a byte.
public ReadPascalString ( ) : string
return string

ReadUInt16() public method

Reads an unsigned 16bit integer from the current stream.
public ReadUInt16 ( ) : ushort
return ushort

ReadUInt32() public method

Reads an unsigned 32bit integer from the current stream.
public ReadUInt32 ( ) : uint
return uint

ReadVarLen() public method

Reads a variable length unsigned integer from the current stream.
public ReadVarLen ( ) : uint
return uint

ReadVariableLengthPascalString() public method

Reads a pascal string from the current stream.
public ReadVariableLengthPascalString ( ) : string
return string

Seek() public method

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.
return void

SeekFromMark() public method

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).
return void

Skip() public method

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.
return void

Property Details

ByteOrder public_oe property

public ByteOrder ByteOrder
return ByteOrder