C# Class Axiom.Serialization.StreamSerializer

Utility class providing helper methods for reading / writing structured data held in a Stream.
The structure of a file read / written by this class is a series of 'chunks'. A chunk-based format has the advantage of being extensible later, and it's robust, in that a reader can skip chunks that they are not able (or willing) to process. Chunks are contained serially in the file, but they can also be nested in order both to provide context, and to group chunks together for potential skipping. The data format of a chunk is as follows: -# Chunk ID (32-bit uint). This can be any number unique in a context, except the numbers 0x0000, 0x0001 and 0x1000, which are reserved for Ogre's use -# Chunk version (16-bit uint). Chunks can change over time so this version number reflects that -# Length (32-bit uint). The length of the chunk data section, including nested chunks. Note that this length excludes this header, but includes the header of any nested chunks. -# Checksum (32-bit uint). Checksum value generated from the above - basically lets us check this is a valid chunk. -# Chunk data The 'Chunk data' section will contain chunk-specific data, which may include other nested chunks.
Inheritance: DisposableObject
ファイルを表示 Open project: mono-soc-2011/axiom Class Usage Examples

Protected Properties

Property Type Description
mChunkStack Deque
mCurrentOffset int
mEndian Endian
mFlipEndian bool
mReadWriteHeader bool
mRealFormat RealStorageFormat
mStream Stream

Public Methods

Method Description
StreamSerializer ( Stream stream ) : System

Default constructor.

StreamSerializer ( Stream stream, Endian endianMode ) : System

Constructor.

StreamSerializer ( Stream stream, Endian endianMode, bool autoHeader ) : System

Constructor.

Method Details

StreamSerializer() public method

Default constructor.
public StreamSerializer ( Stream stream ) : System
stream Stream The stream on which you will read / write data.
return System

StreamSerializer() public method

Constructor.
public StreamSerializer ( Stream stream, Endian endianMode ) : System
stream Stream The stream on which you will read / write data.
endianMode Endian If true, the first write or read to this stream will /// automatically read / write the header too. This is required if you /// set endianMode to Endian.Auto, but if you manually set the endian mode, /// then you can skip writing / reading the header if you wish, if for example /// this stream is midway through a file which has already included header /// information.
return System

StreamSerializer() public method

Constructor.
public StreamSerializer ( Stream stream, Endian endianMode, bool autoHeader ) : System
stream Stream The stream on which you will read / write data.
endianMode Endian If true, the first write or read to this stream will /// automatically read / write the header too. This is required if you /// set endianMode to Endian.Auto, but if you manually set the endian mode, /// then you can skip writing / reading the header if you wish, if for example /// this stream is midway through a file which has already included header /// information.
autoHeader bool If true, the first write or read to this stream will /// automatically read / write the header too. This is required if you /// set endianMode to Endian.Auto, but if you manually set the endian mode, /// then you can skip writing / reading the header if you wish, if for example /// this stream is midway through a file which has already included header /// information.
return System

Property Details

mChunkStack protected_oe property

protected Deque mChunkStack
return Deque

mCurrentOffset protected_oe property

protected int mCurrentOffset
return int

mEndian protected_oe property

protected Endian mEndian
return Endian

mFlipEndian protected_oe property

protected bool mFlipEndian
return bool

mReadWriteHeader protected_oe property

protected bool mReadWriteHeader
return bool

mRealFormat protected_oe property

protected RealStorageFormat mRealFormat
return RealStorageFormat

mStream protected_oe property

protected Stream mStream
return Stream