C# Класс 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.
Наследование: DisposableObject
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
mChunkStack Deque
mCurrentOffset int
mEndian Endian
mFlipEndian bool
mReadWriteHeader bool
mRealFormat RealStorageFormat
mStream Stream

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

Метод Описание
StreamSerializer ( Stream stream ) : System

Default constructor.

StreamSerializer ( Stream stream, Endian endianMode ) : System

Constructor.

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

Constructor.

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

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

Default constructor.
public StreamSerializer ( Stream stream ) : System
stream Stream The stream on which you will read / write data.
Результат System

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

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.
Результат System

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

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.
Результат System

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

mChunkStack защищенное свойство

protected Deque mChunkStack
Результат Deque

mCurrentOffset защищенное свойство

protected int mCurrentOffset
Результат int

mEndian защищенное свойство

protected Endian mEndian
Результат Endian

mFlipEndian защищенное свойство

protected bool mFlipEndian
Результат bool

mReadWriteHeader защищенное свойство

protected bool mReadWriteHeader
Результат bool

mRealFormat защищенное свойство

protected RealStorageFormat mRealFormat
Результат RealStorageFormat

mStream защищенное свойство

protected Stream mStream
Результат Stream