The byte stream is a class to serialize and deserialize byte-wise data. It's mostly used by Quantum asset serialization and deserialization. The data is stored inside a byte array internally. More...
Inherits IDisposable.
Public Member Functions | |
ByteStream () | |
Create a byte stream with the default buffer length and default size. More... | |
ByteStream (Byte[] data) | |
Create a byte stream with a given data array. More... | |
ByteStream (int capacity) | |
Create a byte stream with a given capacity. More... | |
void | Dispose () |
Dispose the byte stream. More... | |
ByteStream | Duplicate () |
Duplicate the stream. More... | |
int | Read7BitEncodedInt () |
Read an integer in compressed format from the byte stream. More... | |
Boolean | ReadBool () |
Reads and returns a bool from the byte stream. More... | |
Byte | ReadByte () |
Read a byte from the byte stream. More... | |
Byte[] | ReadByteArray () |
Read a byte array from the byte stream. More... | |
Char | ReadChar () |
Read a char from the byte stream. More... | |
Guid | ReadGuid () |
Read a Guid from the byte stream. More... | |
Int32 | ReadInt () |
Read an integer from the byte stream. More... | |
Int64 | ReadLong () |
Read a long from the byte stream. More... | |
SByte | ReadSByte () |
Read a signed byte from the byte stream. More... | |
Int16 | ReadShort () |
Read a short from the byte stream. More... | |
UInt32 | ReadUInt () |
Read an unsigned short from the byte stream. More... | |
UInt64 | ReadULong () |
Read an unsigned long from the byte stream. More... | |
UInt16 | ReadUShort () |
Read an unsigned short from the byte stream. More... | |
void | Reset () |
Reset the stream and clear More... | |
Byte[] | ToArray () |
Create a copy of the underlying data array. More... | |
void | Write7BitEncodedInt (int value) |
Writes an integer in a compressed format to the byte stream. More... | |
Boolean | WriteBool (Boolean value) |
Write a bool to the byte stream. More... | |
void | WriteByte (Byte value) |
Write a byte to the byte stream. More... | |
void | WriteByteArray (Byte[] bytes) |
Write a byte array to the byte stream. More... | |
void | WriteByteArray (Byte[] bytes, Int32 offset, Int32 count) |
Write a byte array to the byte stream. More... | |
void | WriteChar (Char value) |
Write a char to the byte stream. More... | |
void | WriteGuid (Guid guid) |
Write a Guid to the byte stream. More... | |
void | WriteInt (Int32 value) |
Write an integer to the byte stream. More... | |
void | WriteLong (Int64 value) |
Write a long to the byte stream. More... | |
void | WriteSByte (SByte value) |
Write a singed byte to the byte stream. More... | |
void | WriteShort (Int16 value) |
Write a short to the byte stream. More... | |
void | WriteUInt (UInt32 value) |
Write an unsigned integer to the byte stream. More... | |
void | WriteULong (UInt64 value) |
Write an unsigned long to the byte stream. More... | |
void | WriteUShort (UInt16 value) |
Write a unsigned short to the byte stream. More... | |
Properties | |
Byte[] | Data [get, set] |
Get or set the underlying data array. More... | |
Int32 | Position [get, set] |
Get or set the current position in the stream. More... | |
The byte stream is a class to serialize and deserialize byte-wise data. It's mostly used by Quantum asset serialization and deserialization. The data is stored inside a byte array internally.
|
inline |
Create a byte stream with a given data array.
data | Data to read from or write to |
|
inline |
Create a byte stream with a given capacity.
capacity | The initial size of the underlying buffer. |
|
inline |
Create a byte stream with the default buffer length and default size.
|
inline |
Reset the stream and clear
|
inline |
Duplicate the stream.
|
inline |
Create a copy of the underlying data array.
|
inline |
Write a bool to the byte stream.
value | Bool |
|
inline |
Reads and returns a bool from the byte stream.
|
inline |
Write a singed byte to the byte stream.
value | Singed byte |
|
inline |
Read a signed byte from the byte stream.
|
inline |
Write a byte to the byte stream.
value | The value to write |
|
inline |
Read a byte from the byte stream.
|
inline |
Write a short to the byte stream.
value | The value to write to the stream. |
|
inline |
Read a short from the byte stream.
|
inline |
Write a char to the byte stream.
value | The value to write to the stream. |
|
inline |
Read a char from the byte stream.
|
inline |
Write a unsigned short to the byte stream.
value | The value to write to the stream. |
|
inline |
Read an unsigned short from the byte stream.
|
inline |
Writes an integer in a compressed format to the byte stream.
value |
|
inline |
Write an integer to the byte stream.
value | The value to write to the stream. |
|
inline |
Read an integer in compressed format from the byte stream.
FormatException | Is raised when the stream is corrupted |
|
inline |
Read an integer from the byte stream.
|
inline |
Write an unsigned integer to the byte stream.
value | The value to write to the stream. |
|
inline |
Read an unsigned short from the byte stream.
|
inline |
Write an unsigned long to the byte stream.
value | The value to write to the stream. |
|
inline |
Read an unsigned long from the byte stream.
|
inline |
Write a long to the byte stream.
value | The value to write to the stream. |
|
inline |
Read a long from the byte stream.
|
inline |
Write a byte array to the byte stream.
bytes | The array to write to the stream. |
|
inline |
Write a byte array to the byte stream.
bytes | The input array |
offset | The offset of the input array |
count | The length of the input array to write |
|
inline |
Read a byte array from the byte stream.
|
inline |
Write a Guid to the byte stream.
guid | The Guid to write to stream. |
|
inline |
Read a Guid from the byte stream.
|
inline |
Dispose the byte stream.
|
getset |
Get or set the current position in the stream.
|
getset |
Get or set the underlying data array.