Writes information at the bit level to a byte array. More...
Public Member Functions | |
BitStream () | |
Constructs a new instance of the BitStream class with a default buffer size of 0. More... | |
BitStream (byte[] arr) | |
Constructs a new instance of the BitStream class with the specified buffer. More... | |
BitStream (byte[] arr, int size) | |
Constructs a new instance of the BitStream class with the specified buffer and size. More... | |
BitStream (byte[] arr, int size, int offset) | |
Constructs a new instance of the BitStream class with the specified buffer, size, and offset. More... | |
BitStream (Int32 size) | |
Constructs a new instance of the BitStream class with the specified buffer size. More... | |
delegate void | ArrayElementSerializer< T > (ref T element) |
Represents a delegate for serializing an array element. More... | |
void | BlockCopyToArray (Array dst, int dstOffset) |
Block copy the bitstream buffer into an array. More... | |
bool | CanRead () |
Determines if there is at least one bit available to read. More... | |
bool | CanRead (int bits) |
Determines whether the BitStream can read the specified number of bits. More... | |
bool | CanWrite () |
Determines whether the BitStream can write one bit. More... | |
bool | CanWrite (int bits) |
Determines if the given number of bits can be written to the BitStream without exceeding the buffer size. More... | |
bool | Condition (bool condition) |
Serializes or deserializes a condition value. More... | |
void | CopyFromArray (Byte[] array) |
Copies data from the input array to the internal buffer. More... | |
unsafe void | CopyFromBuffer (byte *buffer, int length) |
Copies a specified number of bytes from a buffer into the internal buffer of the BitStream. More... | |
bool | ReadBool () |
Reads a boolean value from the current position in the BitStream. More... | |
bool | ReadBoolean () |
Reads a boolean value from the BitStream. More... | |
byte | ReadByte () |
Reads a byte from the bit stream using the default number of bits (8 bits). More... | |
byte | ReadByte (int bits) |
Reads a byte from the BitStream with the specified number of bits. More... | |
void | ReadByteArray (byte[] to) |
Reads a byte array from the BitStream object. More... | |
void | ReadByteArray (byte[] to, int count) |
Reads a byte array from the BitStream, starting from the current position. More... | |
void | ReadByteArray (byte[] to, int offset, int count) |
byte[] | ReadByteArray (int size) |
Reads a byte array from the BitStream with the specified size. More... | |
byte[] | ReadByteArrayLengthPrefixed () |
Reads a byte array from the bit stream that is length prefixed. More... | |
Char | ReadChar () |
Reads a character from the BitStream. More... | |
double | ReadDouble () |
Reads a double value from the bit stream. More... | |
float | ReadFloat () |
Reads a single-precision floating-point number from the BitStream. More... | |
FP | ReadFP () |
The BitStream class is used for reading and writing data in a binary format. More... | |
FPBounds2 | ReadFPBounds2 () |
Reads an instance of FPBounds2 from the BitStream. More... | |
FPBounds3 | ReadFPBounds3 () |
Reads a FPBounds3 structure from the BitStream. More... | |
FPMatrix2x2 | ReadFPMatrix2x2 () |
Reads a 2x2 matrix of fixed-point numbers from the BitStream. More... | |
FPMatrix3x3 | ReadFPMatrix3x3 () |
FPMatrix4x4 | ReadFPMatrix4x4 () |
Reads a 4x4 matrix of Fixed Point numbers from the BitStream. More... | |
FPQuaternion | ReadFPQuaternion () |
Reads and returns an instance of FPQuaternion from the current BitStream. More... | |
FPVector2 | ReadFPVector2 () |
Reads an FPVector2 from the current BitStream. More... | |
FPVector3 | ReadFPVector3 () |
Reads a FPVector3 from the BitStream. More... | |
Guid | ReadGuid () |
Reads a Guid from the BitStream by reading 16 bytes and constructing a Guid object. More... | |
int | ReadInt () |
Reads an integer value from the bit stream. More... | |
int | ReadInt (int bits) |
Reads an integer value from the bit stream. More... | |
int | ReadInt32VarLength (int blockSize) |
Reads a variable-length 32-bit integer from the buffer. More... | |
long | ReadInt64VarLength (int blockSize) |
Reads a variable-length 64-bit signed integer from the BitStream with the specified block size. More... | |
int | ReadInt_Shifted (int bits, int shift) |
Reads an integer value shifted by the specified amount of bits from the BitStream. More... | |
long | ReadLong () |
Reads a long integer from the BitStream. More... | |
long | ReadLong (int bits) |
Reads a long value from the BitStream with the specified number of bits. More... | |
sbyte | ReadSByte () |
Reads a signed byte value from the bit stream. More... | |
short | ReadShort () |
Reads a 16-bit integer from the bit stream. More... | |
short | ReadShort (int bits) |
Reads a short value from the BitStream. More... | |
string | ReadString () |
Reads a string from the BitStream using the specified encoding. More... | |
string | ReadString (Encoding encoding) |
Reads a string from the bit stream using the specified encoding. More... | |
String | ReadStringGZip (Encoding encoding) |
Reads a compressed string from the BitStream using GZip decompression. More... | |
uint | ReadUInt () |
Reads an unsigned 32-bit integer from the BitStream. More... | |
uint | ReadUInt (int bits) |
Reads an unsigned integer from the BitStream with the specified number of bits. More... | |
uint | ReadUInt32VarLength (int blockSize) |
Reads a variable length unsigned 32-bit integer from the BitStream. More... | |
ulong | ReadUInt64VarLength (int blockSize) |
Reads an unsigned 64-bit integer with variable length from the BitStream. More... | |
ulong | ReadULong () |
Reads an unsigned 64-bit integer from the BitStream. More... | |
ulong | ReadULong (int bits) |
Reads an unsigned 64-bit integer (ulong) from the BitStream with the specified number of bits. If the specified number of bits is less than or equal to 32, it reads an unsigned 32-bit integer (uint) instead. More... | |
ushort | ReadUShort () |
Reads an unsigned short (16 bits) from the BitStream. More... | |
ushort | ReadUShort (int bits) |
Reads an unsigned short value from the BitStream. More... | |
void | Reset () |
Resets the BitStream to its initial state. More... | |
void | Reset (Int32 byteSize) |
Resets the BitStream to its initial state, clearing the data and setting the pointer and maximum pointer values. More... | |
void | ResetFast (Int32 byteSize) |
Resets the BitStream to a specified byte size. More... | |
void | RoundTo4Bytes () |
Pads the stream with 0s to make it 4-byte exact. More... | |
int | RoundToByte () |
Rounds the current position in the stream to the nearest byte boundary and returns the number of bytes written up to that point. More... | |
unsafe void | Serialize (byte *v) |
Serializes or deserializes a byte value. More... | |
unsafe void | Serialize (int *v) |
Serializes or deserializes a value of type int*. More... | |
unsafe void | Serialize (int *v, int bits) |
Serializes or deserializes a value. More... | |
unsafe void | Serialize (long *v) |
Serializes or deserializes a long value. More... | |
void | Serialize (ref bool value) |
Serializes or deserializes a boolean value. More... | |
void | Serialize (ref Byte value) |
Serializes or deserializes a Byte value. More... | |
void | Serialize (ref Byte[] array, ref Int32 length) |
Serializes or deserializes an array of bytes with a variable length. More... | |
void | Serialize (ref Byte[] array, ref Int32 length, Int32 fixedSize) |
Serializes or deserializes a byte array with a fixed size. More... | |
void | Serialize (ref Byte[] value) |
Serializes or deserializes a byte array. More... | |
void | Serialize (ref Byte[] value, Int32 fixedSize) |
Serializes or deserializes a fixed-sized byte array. More... | |
void | Serialize (ref Double value) |
Serializes or deserializes a Double value. More... | |
void | Serialize (ref float value) |
Serializes or deserializes a string value. More... | |
void | Serialize (ref FP value) |
Serializes or deserializes an FP value. More... | |
void | Serialize (ref FPQuaternion value) |
Serializes or deserializes an FPQuaternion value. More... | |
void | Serialize (ref FPVector2 value) |
Serializes or deserializes a FPVector2 value. More... | |
void | Serialize (ref FPVector3 value) |
Serializes or deserializes a FPVector3 value. More... | |
void | Serialize (ref int value) |
Serializes or deserializes a value of type int. More... | |
void | Serialize (ref int value, int bits) |
Serializes or deserializes a value of type int with the specified number of bits. More... | |
void | Serialize (ref Int32[] value) |
Serializes or deserializes an array of Int32 values. More... | |
void | Serialize (ref Int64 value) |
Serializes or deserializes a 64-bit signed integer value. More... | |
void | Serialize (ref String value) |
Serializes or deserializes a string value. More... | |
void | Serialize (ref uint value) |
Serializes or deserializes a string value. More... | |
void | Serialize (ref uint value, int bits) |
Serializes or deserializes a given uint value. More... | |
void | Serialize (ref UInt64 value) |
Serializes or deserializes a UInt64 value. More... | |
void | Serialize (ref ulong value, int bits) |
Serializes or deserializes a ulong value with a specified number of bits. More... | |
void | Serialize (ref ushort value) |
Serializes or deserializes a ushort (UInt16) value. More... | |
unsafe void | Serialize (sbyte *v) |
Serializes or deserializes a value. More... | |
unsafe void | Serialize (short *v) |
Serializes or deserializes a short value. More... | |
unsafe void | Serialize (uint *v) |
Serializes or deserializes a pointer to an unsigned integer. More... | |
unsafe void | Serialize (uint *v, int bits) |
Serializes or deserializes a string value. More... | |
unsafe void | Serialize (ulong *v) |
Serializes or deserializes the value pointed to by a ulong pointer. More... | |
unsafe void | Serialize (ushort *v) |
Serializes or deserializes a ushort value. More... | |
void | SerializeArray< T > (ref T[] array, ArrayElementSerializer< T > serializer, int maxLength=int.MaxValue) |
Serializes or deserializes an array using a custom serializer. More... | |
int | SerializeArrayLength< T > (ref T[] array, int maxLength=int.MaxValue) |
Serializes or deserializes the length of a generic array. More... | |
void | SerializeAsByteArray (BitStream otherStream) |
Serializes the given BitStream as a byte array. More... | |
unsafe void | SerializeBuffer (byte *buffer, int length) |
Serializes or deserializes a buffer of bytes. More... | |
unsafe void | SerializeBuffer (int *buffer, int length) |
Serializes or deserializes a buffer of integers. More... | |
unsafe void | SerializeBuffer (long *buffer, int length) |
Serializes or deserializes a buffer of long values. More... | |
unsafe void | SerializeBuffer (sbyte *buffer, int length) |
Serializes or deserializes a buffer of signed bytes. More... | |
unsafe void | SerializeBuffer (short *buffer, int length) |
Serializes or deserializes a buffer of type short . More... | |
unsafe void | SerializeBuffer (uint *buffer, int length) |
unsafe void | SerializeBuffer (ulong *buffer, int length) |
Serializes or deserializes a buffer of ulong values. More... | |
unsafe void | SerializeBuffer (ushort *buffer, int length) |
Serializes or deserializes a buffer of unsigned shorts. More... | |
void | SetBuffer (byte[] arr) |
Sets the buffer of the BitStream with the specified byte array. More... | |
void | SetBuffer (byte[] arr, int size) |
Sets the buffer and size of the BitStream instance. More... | |
void | SetBuffer (byte[] arr, int size, int offset) |
Sets the buffer of the BitStream instance. More... | |
byte[] | ToArray () |
Copies the data from the BitStream into a new byte array. More... | |
bool | WriteBool (bool value) |
Writes a boolean value to the bit stream. More... | |
bool | WriteBoolean (bool value) |
Writes a boolean value to the BitStream. More... | |
void | WriteByte (byte value) |
Writes a byte value to the BitStream using 8 bits. More... | |
void | WriteByte (byte value, int bits) |
Writes a byte value to the BitStream with a specified number of bits. More... | |
void | WriteByteArray (byte[] from) |
Writes a byte array to the BitStream. More... | |
void | WriteByteArray (byte[] from, int count) |
Writes a byte array to the BitStream starting from a specified offset and writing a specified number of bytes. More... | |
void | WriteByteArray (byte[] from, int offset, int count) |
Writes a byte array to the BitStream. More... | |
void | WriteByteArrayLengthPrefixed (byte[] array) |
Writes a byte array to the BitStream with a length prefix. More... | |
void | WriteByteArrayLengthPrefixed (byte[] array, int maxLength) |
Writes a byte array to the bit stream in a length-prefixed format. More... | |
void | WriteChar (Char value) |
Writes a character to the BitStream by converting it to a 16-bit unsigned integer. More... | |
void | WriteDouble (double value) |
Writes a double value to the bit stream. More... | |
void | WriteFloat (float value) |
Writes a single-precision floating-point value to the BitStream. More... | |
void | WriteFP (FP fp) |
Writes the given fixed-point value to the bit stream. More... | |
void | WriteFPBounds2 (FPBounds2 v) |
Writes an instance of FPBounds2 to the current BitStream object. More... | |
void | WriteFPBounds3 (FPBounds3 v) |
Writes the FPBounds3 structure to the BitStream. More... | |
void | WriteFPMatrix2x2 (FPMatrix2x2 v) |
Writes a FPMatrix2x2 to the BitStream. More... | |
void | WriteFPMatrix3x3 (FPMatrix3x3 v) |
Writes a 3x3 matrix of fixed-point numbers to the current instance of the BitStream. More... | |
void | WriteFPMatrix4x4 (FPMatrix4x4 v) |
Writes a 4x4 matrix of Fixed Point (FP) values to the bit stream. More... | |
void | WriteFPQuaternion (FPQuaternion v) |
Writes a FPQuaternion value to the BitStream. More... | |
void | WriteFPVector2 (FPVector2 v) |
Writes an instance of FPVector2 to the BitStream. More... | |
void | WriteFPVector3 (FPVector3 v) |
Writes an FPVector3 to the BitStream. More... | |
void | WriteGuid (Guid guid) |
Writes a Guid to the BitStream. More... | |
void | WriteInt (int value) |
Writes an integer value to the BitStream using a specified number of bits. More... | |
void | WriteInt (int value, int bits) |
Writes an integer value to the bitstream using the specified number of bits. More... | |
void | WriteInt32VarLength (int value, int blockSize) |
Writes a variable length int32 value to the BitStream. More... | |
void | WriteInt64VarLength (long value, int blockSize) |
Writes a signed 64-bit integer using variable-length encoding to the bit stream. More... | |
void | WriteInt_Shifted (int value, int bits, int shift) |
Writes an integer value to the BitStream with specified number of bits and a shift value. More... | |
void | WriteLong (long value) |
Writes a long value to the BitStream. More... | |
void | WriteLong (long value, int bits) |
Writes a long value to the BitStream with the specified number of bits. More... | |
void | WriteNullableFP (FP fp) |
Writes a nullable fixed-point value to the BitStream. More... | |
void | WriteSByte (sbyte value) |
Writes a signed byte value to the bit stream. More... | |
void | WriteShort (short value) |
Writes a short value to the BitStream using the specified number of bits. More... | |
void | WriteShort (short value, int bits) |
Writes a signed 16-bit integer value to the BitStream with specified number of bits. More... | |
void | WriteString (string value) |
Writes a string to the BitStream using the specified encoding. More... | |
void | WriteString (string value, Encoding encoding) |
Writes a string value to the BitStream using the specified encoding. More... | |
void | WriteStringGZip (String value, Encoding encoding) |
Writes a string to the BitStream using GZip compression. More... | |
void | WriteUInt (uint value) |
Writes an unsigned integer value of 32 bits to the bit stream. More... | |
void | WriteUInt (uint value, int bits) |
Writes an unsigned integer value to the BitStream with the specified number of bits. More... | |
void | WriteUInt32VarLength (uint value, int blockSize) |
Writes a variable-length unsigned 32-bit integer to the BitStream. More... | |
void | WriteUInt64VarLength (ulong value, int blockSize) |
Writes a UInt64 variable-length value to the BitStream using the specified blockSize. More... | |
void | WriteULong (ulong value) |
Writes an unsigned long value to the bit stream using a specified number of bits. More... | |
void | WriteULong (ulong value, int bits) |
Writes an unsigned long value to the bit stream. If the number of bits is less than or equal to 32, it writes the lower 32 bits of the value. Otherwise, it writes the lower 32 bits first, followed by the remaining bits. More... | |
void | WriteUShort (ushort value) |
Writes a ushort value to the BitStream. More... | |
void | WriteUShort (ushort value, int bits) |
Writes an unsigned short value to the BitStream. More... | |
Static Public Member Functions | |
static void | WriteByteAt (byte[] data, int ptr, int bits, byte value) |
Writes a byte value at the specified position in a byte array, considering the number of bits to be written for the value. More... | |
Properties | |
int | BytesRequired [get] |
Gets the number of bytes required to represent the current position of the stream pointer in the BitStream. More... | |
int | Capacity [get] |
Gets the capacity of the BitStream, in bytes. More... | |
Byte[] | Data [get] |
Represents the data buffer used by the BitStream. More... | |
bool | Done [get] |
Gets a value indicating whether the stream pointer of the BitStream has reached the maximum pointer position. More... | |
bool | DoneOrOverflow [get] |
Indicates whether a bit stream is done (reached the end) or overflowing. More... | |
bool | IsEvenBytes [get] |
Gets a value indicating whether the position of the stream pointer in the BitStream is aligned on even bytes. More... | |
int | Offset [get] |
Represents the offset in bytes from the beginning of the byte array in the BitStream. More... | |
int | OffsetBits [get] |
Represents the offset in bits from the start of the BitStream. More... | |
bool | Overflowing [get] |
Gets a value indicating whether the stream pointer of the BitStream has exceeded the maximum pointer position. More... | |
int | Position [get, set] |
Represents the position of the stream pointer in the BitStream. More... | |
bool | Reading [get, set] |
Gets or sets a value indicating whether the stream is in reading mode. More... | |
bool | Writing [get, set] |
Represents the property indicating whether writing is enabled in the BitStream. More... | |
Writes information at the bit level to a byte array.
|
inline |
Constructs a new instance of the BitStream class with a default buffer size of 0.
|
inline |
Constructs a new instance of the BitStream class with the specified buffer size.
size | The size of the internal buffer. |
|
inline |
Constructs a new instance of the BitStream class with the specified buffer.
arr | The source data buffer. |
|
inline |
Constructs a new instance of the BitStream class with the specified buffer and size.
arr | The source data buffer. |
size | The size to use. |
|
inline |
Constructs a new instance of the BitStream class with the specified buffer, size, and offset.
arr | The source data buffer. |
size | The size to use. |
offset | The offset to use. |
|
inline |
Sets the buffer of the BitStream with the specified byte array.
arr | The byte array to set as the buffer. |
|
inline |
Sets the buffer and size of the BitStream instance.
arr | The byte array buffer. |
size | The size of the buffer. |
|
inline |
Sets the buffer of the BitStream instance.
arr | The byte array to set as the buffer for the BitStream. |
size | The size of the buffer in bytes. |
offset | The offset in bytes from the start of the buffer. |
|
inline |
Rounds the current position in the stream to the nearest byte boundary and returns the number of bytes written up to that point.
|
inline |
Pads the stream with 0s to make it 4-byte exact.
|
inline |
Determines whether the BitStream can write one bit.
true
if the BitStream can write a bit, otherwise false
.
|
inline |
Determines if there is at least one bit available to read.
true
if there is one bit available to read; otherwise, false
.
|
inline |
Determines if the given number of bits can be written to the BitStream without exceeding the buffer size.
bits | The number of bits to be written. |
true
if the given number of bits can be written to the BitStream without exceeding the buffer size; otherwise, false
.
|
inline |
Determines whether the BitStream can read the specified number of bits.
bits | The number of bits to check if can be read. |
true
if the BitStream can read the specified number of bits, false
otherwise.
|
inline |
Copies data from the input array to the internal buffer.
array | The input array to copy data from. |
|
inline |
Copies a specified number of bytes from a buffer into the internal buffer of the BitStream.
buffer | A pointer to the buffer containing the bytes to be copied. |
length | The number of bytes to copy. |
|
inline |
Block copy the bitstream buffer into an array.
|
inline |
Resets the BitStream to its initial state.
|
inline |
Resets the BitStream to its initial state, clearing the data and setting the pointer and maximum pointer values.
|
inline |
Resets the BitStream to a specified byte size.
byteSize | The size, in bytes, to reset the BitStream to. |
|
inline |
Copies the data from the BitStream into a new byte array.
|
inline |
Writes a boolean value to the bit stream.
value | The boolean value to write. |
|
inline |
Writes a boolean value to the BitStream.
value | The boolean value to write. |
true
if the value was written successfully; otherwise, false
.
|
inline |
Reads a boolean value from the current position in the BitStream.
true
(1) or false
(0).
|
inline |
Reads a boolean value from the BitStream.
|
inline |
Writes a byte value to the BitStream with a specified number of bits.
value | The byte value to write. |
bits | The number of bits to write. |
|
inline |
Reads a byte from the BitStream with the specified number of bits.
bits | The number of bits to read the byte. |
|
inline |
Writes a byte value to the BitStream using 8 bits.
value | The byte value to be written. |
|
inline |
Reads a byte from the bit stream using the default number of bits (8 bits).
|
inline |
Reads a signed byte value from the bit stream.
|
inline |
Writes a signed byte value to the bit stream.
value | The signed byte value to write. |
|
inline |
Writes an unsigned short value to the BitStream.
value | The value to write. |
bits | The number of bits to write. |
|
inline |
Reads an unsigned short value from the BitStream.
bits | The number of bits to read, must be less than or equal to 16. |
|
inline |
Writes a ushort value to the BitStream.
value | The ushort value to write. |
|
inline |
Reads an unsigned short (16 bits) from the BitStream.
|
inline |
Writes a signed 16-bit integer value to the BitStream with specified number of bits.
value | The value to write. |
bits | The number of bits to write. Must be between 1 and 16, inclusive. |
|
inline |
Reads a short value from the BitStream.
bits | The number of bits to read. |
|
inline |
Writes a short value to the BitStream using the specified number of bits.
value | The short value to write. |
The specified number of bits determines the size of the value that can be written.
|
inline |
Reads a 16-bit integer from the bit stream.
|
inline |
Writes a character to the BitStream by converting it to a 16-bit unsigned integer.
value | The character to write. |
|
inline |
Reads a character from the BitStream.
|
inline |
Writes a signed 64-bit integer using variable-length encoding to the bit stream.
value | The signed 64-bit integer to write. |
blockSize | The block size for encoding the integer. |
|
inline |
Writes a variable length int32 value to the BitStream.
value | The int32 value to be written. |
blockSize | The block size to use. |
|
inline |
Reads a variable-length 64-bit signed integer from the BitStream with the specified block size.
blockSize | The block size for reading the variable-length integer. |
|
inline |
Reads a variable-length 32-bit integer from the buffer.
blockSize | The block size used for encoding the integer. |
|
inline |
Reads a variable length unsigned 32-bit integer from the BitStream.
blockSize | The size of each block of bits to read. |
|
inline |
Reads an unsigned 64-bit integer with variable length from the BitStream.
blockSize | The number of bits in each block. Must be between 2 and 16 (inclusive). |
|
inline |
Writes a variable-length unsigned 32-bit integer to the BitStream.
value | The value to write. |
blockSize | The number of bits per block. Must be between 2 and 16 (inclusive). |
|
inline |
Writes a UInt64 variable-length value to the BitStream using the specified blockSize.
value | The UInt64 value to write. |
blockSize | The size of each block in bits. |
|
inline |
Writes an unsigned integer value to the BitStream with the specified number of bits.
value | The value to write. |
bits | The number of bits to write. |
|
inline |
|
inline |
Writes an unsigned integer value of 32 bits to the bit stream.
value | The unsigned integer value to write. |
|
inline |
Reads an unsigned 32-bit integer from the BitStream.
|
inline |
Writes an integer value to the BitStream with specified number of bits and a shift value.
value | The integer value to be written. |
bits | The number of bits to use to represent the integer value. |
shift | The shift value to apply to the integer value before writing. |
|
inline |
Reads an integer value shifted by the specified amount of bits from the BitStream.
bits | The number of bits to read from the BitStream. |
shift | The amount of bits to shift the read value by. |
|
inline |
Writes an integer value to the bitstream using the specified number of bits.
value | The integer value to be written to the bitstream. |
bits | The number of bits to use for writing the integer value. |
|
inline |
Reads an integer value from the bit stream.
bits | The number of bits to read. |
|
inline |
Writes an integer value to the BitStream using a specified number of bits.
value | The integer value to write |
|
inline |
Reads an integer value from the bit stream.
|
inline |
Writes an unsigned long value to the bit stream. If the number of bits is less than or equal to 32, it writes the lower 32 bits of the value. Otherwise, it writes the lower 32 bits first, followed by the remaining bits.
value | The value to be written |
bits | The number of bits to write |
|
inline |
Reads an unsigned 64-bit integer (ulong) from the BitStream with the specified number of bits. If the specified number of bits is less than or equal to 32, it reads an unsigned 32-bit integer (uint) instead.
bits | The number of bits to read. |
|
inline |
Writes an unsigned long value to the bit stream using a specified number of bits.
value | The unsigned long value to write. |
|
inline |
Reads an unsigned 64-bit integer from the BitStream.
|
inline |
Writes a long value to the BitStream with the specified number of bits.
value | The long value to write. |
bits | The number of bits to use for encoding the value. |
|
inline |
Reads a long value from the BitStream with the specified number of bits.
bits | The number of bits to read. |
|
inline |
Writes a long value to the BitStream.
value | The long value to write. |
|
inline |
Reads a long integer from the BitStream.
|
inline |
Writes a single-precision floating-point value to the BitStream.
value | The value to be written. |
|
inline |
Reads a single-precision floating-point number from the BitStream.
|
inline |
Writes a double value to the bit stream.
value | The double value to write. |
|
inline |
Reads a double value from the bit stream.
|
inline |
Writes a byte array to the BitStream.
from | The byte array to write |
|
inline |
Writes a byte array to the BitStream starting from a specified offset and writing a specified number of bytes.
from | The byte array to write from. |
count | The number of bytes to write. |
|
inline |
Writes a byte array to the BitStream.
from | The byte array to write. |
offset | The starting index of the byte array to write. |
count | The number of bytes to write from the byte array. |
|
inline |
|
inline |
Reads a byte array from the BitStream object.
to | The byte array to read the data into. |
|
inline |
Reads a byte array from the BitStream, starting from the current position.
to | The array to read into. |
count | The number of bytes to read. |
|
inline |
to | |
offset | |
count |
|
inline |
Writes a byte array to the BitStream with a length prefix.
array | The byte array to write. |
|
inline |
Writes a byte array to the bit stream in a length-prefixed format.
array | The byte array to write. |
maxLength | The maximum length of the byte array to write. |
|
inline |
Reads a byte array from the bit stream that is length prefixed.
null
if the length prefix is false
.
|
inline |
Writes a string value to the BitStream using the specified encoding.
value | The string value to write. |
encoding | The encoding to use. |
|
inline |
Writes a string to the BitStream using the specified encoding.
value | The string to write to the BitStream. |
|
inline |
Reads a string from the bit stream using the specified encoding.
encoding | The encoding used to decode the string. |
|
inline |
Reads a string from the BitStream using the specified encoding.
|
inline |
Writes a string to the BitStream using GZip compression.
value | The string value to write. |
encoding | The encoding to use when compressing the string. |
|
inline |
Reads a compressed string from the BitStream using GZip decompression.
encoding | The encoding to use for the string. |
|
inline |
Writes a Guid to the BitStream.
guid | The Guid to write. |
|
inline |
Reads a Guid from the BitStream by reading 16 bytes and constructing a Guid object.
|
inline |
Writes the given fixed-point value to the bit stream.
fp | The fixed-point value to write. |
|
inline |
The BitStream class is used for reading and writing data in a binary format.
This class provides methods for reading and writing various types of data, including integers, floats, and custom types such as FP (fixed-point), FPVector2, and FPVector3.
|
inline |
Writes a nullable fixed-point value to the BitStream.
fp | The nullable fixed-point value to write. |
|
inline |
Writes an instance of FPVector2 to the BitStream.
v | The FPVector2 instance to write. |
|
inline |
Reads an FPVector2 from the current BitStream.
|
inline |
Writes an FPVector3 to the BitStream.
v | The FPVector3 value to write. |
|
inline |
Reads a FPVector3 from the BitStream.
|
inline |
Writes a FPQuaternion value to the BitStream.
v | The FPQuaternion value to write. |
|
inline |
Reads and returns an instance of FPQuaternion from the current BitStream.
|
inline |
Writes a FPMatrix2x2 to the BitStream.
v | The FPMatrix2x2 to write. |
|
inline |
Reads a 2x2 matrix of fixed-point numbers from the BitStream.
|
inline |
Writes a 3x3 matrix of fixed-point numbers to the current instance of the BitStream.
v | The FPMatrix3x3 to write. |
|
inline |
Reads a 3x3 matrix of fixed-point numbers from the BitStream.
/
|
inline |
Writes a 4x4 matrix of Fixed Point (FP) values to the bit stream.
v | The 4x4 matrix of FP values to be written. |
|
inline |
Reads a 4x4 matrix of Fixed Point numbers from the BitStream.
|
inline |
|
inline |
|
inline |
Writes the FPBounds3 structure to the BitStream.
v | The FPBounds3 structure to be written. |
|
inline |
|
inlinestatic |
Writes a byte value at the specified position in a byte array, considering the number of bits to be written for the value.
data | The byte array in which the value will be written. |
ptr | The position in the byte array to write the value. |
bits | The number of bits to be written for the value. |
value | The byte value to be written. |
delegate void Photon.Deterministic.BitStream.ArrayElementSerializer< T > | ( | ref T | element | ) |
Represents a delegate for serializing an array element.
T | Type of the array element. |
element | Reference to the array element. |
|
inline |
Serializes or deserializes a condition value.
condition | The condition value to serialize or deserialize. |
|
inline |
Serializes or deserializes a string value.
value | The string value to serialize or deserialize. |
|
inline |
Serializes or deserializes a boolean value.
value | The boolean value to serialize or deserialize. |
|
inline |
Serializes or deserializes a string value.
value | The string value to serialize or deserialize. |
|
inline |
Serializes or deserializes a Double value.
value | The Double value to serialize or deserialize. |
|
inline |
Serializes or deserializes a 64-bit signed integer value.
value | The 64-bit signed integer value to serialize or deserialize. |
|
inline |
Serializes or deserializes a UInt64 value.
value | The UInt64 value to serialize or deserialize. |
|
inline |
Serializes or deserializes a ushort (UInt16) value.
value | The value to serialize or deserialize. |
|
inline |
Serializes or deserializes an FP value.
value | The FP value to serialize or deserialize. |
|
inline |
|
inline |
Serializes or deserializes a FPVector3 value.
value | The FPVector3 value to serialize or deserialize. |
|
inline |
Serializes or deserializes an FPQuaternion value.
value | The FPQuaternion value to serialize or deserialize. |
|
inline |
Serializes or deserializes a Byte value.
value | The value to serialize or deserialize. |
|
inline |
Serializes or deserializes a string value.
value | The string value to serialize or deserialize. |
|
inline |
Serializes or deserializes a given uint value.
value | The value to serialize or deserialize. |
bits | The number of bits to use for serialization or deserialization. |
|
inline |
Serializes or deserializes a ulong value with a specified number of bits.
value | The ulong value to serialize or deserialize. |
bits | The number of bits to use for serialization or deserialization. |
|
inline |
Serializes or deserializes a value of type int.
value | The value of type int to serialize or deserialize. |
|
inline |
Serializes or deserializes a value of type int with the specified number of bits.
value | The int value to serialize or deserialize. |
bits | The number of bits used to represent the int value. |
|
inline |
Serializes or deserializes an array of Int32 values.
value | The array of Int32 values to serialize or deserialize. |
|
inline |
Serializes or deserializes a byte array.
value | The byte array to serialize or deserialize. |
|
inline |
Serializes the given BitStream as a byte array.
otherStream | The BitStream to be serialized. |
NotImplementedException | Thrown if the otherStream's Data array is null . |
|
inline |
Serializes or deserializes an array of bytes with a variable length.
array | The array to serialize or deserialize. |
length | The length of the array. |
|
inline |
Serializes or deserializes a fixed-sized byte array.
value | The byte array to serialize or deserialize. |
fixedSize | The fixed size of the byte array. |
|
inline |
Serializes or deserializes a byte array with a fixed size.
array | The byte array to serialize or deserialize. |
length | The length of the byte array. |
fixedSize | The fixed size of the byte array. |
|
inline |
Serializes or deserializes the length of a generic array.
T | The type of the elements in the array. |
array | The array to serialize or deserialize. |
maxLength | The max size of the input array as a safety mechanism to limit the buffers allocated on deserializing commands for example. |
|
inline |
Serializes or deserializes an array using a custom serializer.
T | The type of elements in the array. |
array | The array to serialize or deserialize. |
serializer | The custom serializer for the array elements. |
maxLength | The max size of the input array as a safety mechanism to limit the buffers allocated on deserializing commands for example. |
If write mode is enabled, the method serializes the length of the array, followed by each element of the array using the provided serializer. If write mode is disabled, the method deserializes the length of the array, creates a new array of the appropriate length, and populates the new array by deserializing each array element using the provided serializer.
|
inline |
Serializes or deserializes a byte value.
v | The byte value to serialize or deserialize. |
|
inline |
Serializes or deserializes a value.
v | The value to serialize or deserialize. |
|
inline |
Serializes or deserializes a short value.
v | Pointer to the short value to serialize or deserialize. |
|
inline |
Serializes or deserializes a ushort value.
v | The ushort value to serialize or deserialize. |
|
inline |
Serializes or deserializes a value of type int*.
v | The pointer to the int value to serialize or deserialize. |
|
inline |
Serializes or deserializes a pointer to an unsigned integer.
v | The pointer to an unsigned integer to serialize or deserialize. |
|
inline |
Serializes or deserializes a long value.
v | A pointer to the long value to serialize or deserialize. |
|
inline |
Serializes or deserializes the value pointed to by a ulong pointer.
v | The ulong pointer to the value to serialize or deserialize. |
|
inline |
Serializes or deserializes a string value.
v | The string value to serialize or deserialize. |
bits | The amount of bits to serialize or deserialize. |
|
inline |
Serializes or deserializes a value.
v | The value to serialize or deserialize. |
bits | The number of bits to use for serialization. |
|
inline |
Serializes or deserializes a buffer of bytes.
buffer | A pointer to the buffer of bytes to serialize or deserialize. |
length | The length of the buffer. |
If in write mode, the method writes each byte from the buffer to the stream. If in read mode, the method reads each byte from the stream and stores it in the buffer.
|
inline |
Serializes or deserializes a buffer of signed bytes.
buffer | The buffer of signed bytes to serialize or deserialize. |
length | The length of the buffer. |
|
inline |
Serializes or deserializes a buffer of type short
.
buffer | The buffer to serialize or deserialize. |
length | The length of the buffer. |
If _write
is true
, the method writes each element of the buffer to the bit stream. If _write
is false
, the method reads each element of the buffer from the bit stream.
|
inline |
Serializes or deserializes a buffer of unsigned shorts.
buffer | The buffer of unsigned shorts to serialize or deserialize. |
length | The length of the buffer. |
|
inline |
Serializes or deserializes a buffer of integers.
buffer | The buffer of integers to serialize or deserialize. |
length | The length of the buffer. |
|
inline |
buffer | |
length |
|
inline |
Serializes or deserializes a buffer of long values.
buffer | The buffer of long values to serialize or deserialize. |
length | The length of the buffer. |
|
inline |
Serializes or deserializes a buffer of ulong values.
buffer | A pointer to the buffer to serialize or deserialize. |
length | The length of the buffer. |
|
getset |
Represents the position of the stream pointer in the BitStream.
|
get |
Gets the number of bytes required to represent the current position of the stream pointer in the BitStream.
This property is calculated based on the current position of the stream pointer in bits and converted to bytes.
|
get |
Gets a value indicating whether the position of the stream pointer in the BitStream is aligned on even bytes.
The position of the stream pointer is considered to be aligned on even bytes if the remainder of division by 8 is 0. For example, if the value is 16, it is aligned on even bytes, but if the value is 17, it is not aligned on even bytes.
|
get |
Gets the capacity of the BitStream, in bytes.
The capacity of the BitStream, in bytes.
|
get |
Represents the offset in bytes from the beginning of the byte array in the BitStream.
|
get |
Represents the offset in bits from the start of the BitStream.
|
get |
Gets a value indicating whether the stream pointer of the BitStream has reached the maximum pointer position.
|
get |
Gets a value indicating whether the stream pointer of the BitStream has exceeded the maximum pointer position.
The Overflowing property returns true
if the stream pointer is greater than the maximum pointer position, indicating that the stream has overflowed.
|
get |
Indicates whether a bit stream is done (reached the end) or overflowing.
true
if the bit stream is done or overflowing; otherwise, false
.
|
getset |
Represents the property indicating whether writing is enabled in the BitStream.
true
if writing is enabled; otherwise, false
.
|
getset |
Gets or sets a value indicating whether the stream is in reading mode.
true
if the stream is in reading mode; otherwise, false
.
|
get |
Represents the data buffer used by the BitStream.