C# Class AlbLib.IFF.IFFReader

Class used when reading files in IFF format.
Show file Open project: IllidanS4/AlbLib Class Usage Examples

Public Methods

Method Description
IFFReader ( Stream input ) : System

Initializes new instance using stream.

ReadAll ( ) : IEnumerable

Enumerates through all chunks in file.

ReadByte ( ) : byte

Reads one byte.

ReadBytes ( int count ) : byte[]

Reads bytes with specified count.

ReadChunkHeader ( ) : IFFChunk

Reads chunk header.

ReadFileHeader ( ) : IFFFile

Reads file header on beginning of data.

ReadInt16 ( ) : short

Reads one int16. Automatically converted to little endian.

ReadInt32 ( ) : int

Reads one int32. Automatically converted to little endian.

ReadRest ( ) : void

Reads all remaining bytes from chunk.

ReadUInt16 ( ) : ushort

Reads one uint16. Automatically converted to little endian.

ReadUInt32 ( ) : uint

Reads one uint32. Automatically converted to little endian.

ReadUnpack ( int count ) : byte[]

Reads packed bytes with specified count.

ToLittleEndian ( int value ) : int

Converts value in big endian to current endian.

ToLittleEndian ( short value ) : short

Converts value in big endian to current endian.

ToLittleEndian ( uint value ) : uint

Converts value in big endian to current endian.

ToLittleEndian ( ushort value ) : ushort

Converts value in big endian to current endian.

Unpack ( Stream input, int size, int &read ) : byte[]

Reads packed data from stream.

Unpack ( Stream input, Stream output, int size ) : int

Reads packed data from stream.

Method Details

IFFReader() public method

Initializes new instance using stream.
public IFFReader ( Stream input ) : System
input Stream /// Input stream. ///
return System

ReadAll() public method

Enumerates through all chunks in file.
public ReadAll ( ) : IEnumerable
return IEnumerable

ReadByte() public method

Reads one byte.
public ReadByte ( ) : byte
return byte

ReadBytes() public method

Reads bytes with specified count.
public ReadBytes ( int count ) : byte[]
count int /// Bytes count. ///
return byte[]

ReadChunkHeader() public method

Reads chunk header.
public ReadChunkHeader ( ) : IFFChunk
return IFFChunk

ReadFileHeader() public method

Reads file header on beginning of data.
public ReadFileHeader ( ) : IFFFile
return IFFFile

ReadInt16() public method

Reads one int16. Automatically converted to little endian.
public ReadInt16 ( ) : short
return short

ReadInt32() public method

Reads one int32. Automatically converted to little endian.
public ReadInt32 ( ) : int
return int

ReadRest() public method

Reads all remaining bytes from chunk.
public ReadRest ( ) : void
return void

ReadUInt16() public method

Reads one uint16. Automatically converted to little endian.
public ReadUInt16 ( ) : ushort
return ushort

ReadUInt32() public method

Reads one uint32. Automatically converted to little endian.
public ReadUInt32 ( ) : uint
return uint

ReadUnpack() public method

Reads packed bytes with specified count.
public ReadUnpack ( int count ) : byte[]
count int /// Bytes count. ///
return byte[]

ToLittleEndian() public static method

Converts value in big endian to current endian.
public static ToLittleEndian ( int value ) : int
value int /// Value to convert. ///
return int

ToLittleEndian() public static method

Converts value in big endian to current endian.
public static ToLittleEndian ( short value ) : short
value short /// Value to convert. ///
return short

ToLittleEndian() public static method

Converts value in big endian to current endian.
public static ToLittleEndian ( uint value ) : uint
value uint /// Value to convert. ///
return uint

ToLittleEndian() public static method

Converts value in big endian to current endian.
public static ToLittleEndian ( ushort value ) : ushort
value ushort /// Value to convert. ///
return ushort

Unpack() public static method

Reads packed data from stream.
public static Unpack ( Stream input, int size, int &read ) : byte[]
input Stream /// Input stream. ///
size int /// Data size. ///
read int /// Bytes read. ///
return byte[]

Unpack() public static method

Reads packed data from stream.
public static Unpack ( Stream input, Stream output, int size ) : int
input Stream /// Input stream. ///
output Stream /// Output stream. ///
size int /// Data size. ///
return int