Photon Fusion 2.0.3

Public Member Functions | Public Attributes | Properties | List of all members
NetBitBufferNull Struct Reference

Represents a null bit buffer for writing data. More...

Inherits INetBitWriteStream.

Public Member Functions

void PadToByteBoundary ()
 Pads the buffer to the next byte boundary by writing zero bits if necessary. More...
 
bool WriteBoolean (bool b)
 Writes a boolean value to the buffer and increments the offset by 1 bit. More...
 
void WriteByte (byte value, int bits=8)
 Writes a byte value to the buffer and increments the offset by the specified number of bits. More...
 
unsafe void WriteBytesAligned (void *buffer, int length)
 Writes a specified number of bytes from a buffer to the bit buffer, ensuring byte alignment. More...
 
void WriteInt32 (int value, int bits=32)
 Writes a 32-bit integer value to the buffer and increments the offset by the specified number of bits. More...
 
void WriteInt32VarLength (int value)
 Writes a 32-bit integer value with variable length encoding. More...
 
void WriteInt32VarLength (int value, int blockSize)
 Writes a 32-bit integer value with variable length encoding and a specified block size. More...
 
void WriteUInt32VarLength (uint value)
 Writes a 32-bit unsigned integer value with variable length encoding. More...
 
void WriteUInt32VarLength (uint value, int blockSize)
 Writes a 32-bit unsigned integer value with variable length encoding and a specified block size. More...
 
void WriteUInt64VarLength (ulong value, int blockSize)
 Writes a 64-bit unsigned integer value with variable length encoding and a specified block size. More...
 

Public Attributes

int _offsetBits
 

Properties

int OffsetBits [get, set]
 Gets or sets the offset in bits. More...
 
- Properties inherited from INetBitWriteStream
int OffsetBits [get]
 Gets the current offset in bits. More...
 

Detailed Description

Represents a null bit buffer for writing data.

Member Function Documentation

◆ PadToByteBoundary()

void PadToByteBoundary ( )

Pads the buffer to the next byte boundary by writing zero bits if necessary.

◆ WriteBoolean()

bool WriteBoolean ( bool  b)

Writes a boolean value to the buffer and increments the offset by 1 bit.

Parameters
bThe boolean value to write.
Returns
The boolean value that was written.

Implements INetBitWriteStream.

◆ WriteByte()

void WriteByte ( byte  value,
int  bits = 8 
)

Writes a byte value to the buffer and increments the offset by the specified number of bits.

Parameters
valueThe byte value to write.
bitsThe number of bits to write. Default is 8.

◆ WriteBytesAligned()

unsafe void WriteBytesAligned ( void *  buffer,
int  length 
)

Writes a specified number of bytes from a buffer to the bit buffer, ensuring byte alignment.

Parameters
bufferA pointer to the buffer containing the bytes to write.
lengthThe number of bytes to write.

Implements INetBitWriteStream.

◆ WriteInt32()

void WriteInt32 ( int  value,
int  bits = 32 
)

Writes a 32-bit integer value to the buffer and increments the offset by the specified number of bits.

Parameters
valueThe 32-bit integer value to write.
bitsThe number of bits to write. Default is 32.

Implements INetBitWriteStream.

◆ WriteInt32VarLength() [1/2]

void WriteInt32VarLength ( int  value)

Writes a 32-bit integer value with variable length encoding.

Parameters
valueThe 32-bit integer value to write.

Implements INetBitWriteStream.

◆ WriteInt32VarLength() [2/2]

void WriteInt32VarLength ( int  value,
int  blockSize 
)

Writes a 32-bit integer value with variable length encoding and a specified block size.

Parameters
valueThe 32-bit integer value to write.
blockSizeThe block size for encoding.

Implements INetBitWriteStream.

◆ WriteUInt32VarLength() [1/2]

void WriteUInt32VarLength ( uint  value)

Writes a 32-bit unsigned integer value with variable length encoding.

Parameters
valueThe 32-bit unsigned integer value to write.

◆ WriteUInt32VarLength() [2/2]

void WriteUInt32VarLength ( uint  value,
int  blockSize 
)

Writes a 32-bit unsigned integer value with variable length encoding and a specified block size.

Parameters
valueThe 32-bit unsigned integer value to write.
blockSizeThe block size for encoding.

◆ WriteUInt64VarLength()

void WriteUInt64VarLength ( ulong  value,
int  blockSize 
)

Writes a 64-bit unsigned integer value with variable length encoding and a specified block size.

Parameters
valueThe 64-bit unsigned integer value to write.
blockSizeThe block size for encoding.

Implements INetBitWriteStream.

Property Documentation

◆ OffsetBits

int OffsetBits
getset

Gets or sets the offset in bits.

The current offset in bits.