Photon Fusion 2.0.9

Public Member Functions | Properties | List of all members
INetBitWriteStream Interface Reference

Interface for writing bits to a stream. More...

Inherited by NetBitBuffer, and NetBitBufferNull.

Public Member Functions

bool WriteBoolean (bool b)
 Writes a boolean value to the stream. More...
 
void WriteBytesAligned (Span< byte > buffer)
 Writes a sequence of bytes to the stream, aligned to byte boundaries. More...
 
void WriteBytesAligned (void *buffer, int length)
 Writes a sequence of bytes to the stream, aligned to byte boundaries. More...
 
void WriteInt32 (int value, int bits=32)
 Writes a 32-bit signed integer to the stream. More...
 
void WriteInt32VarLength (int value)
 Writes a 32-bit signed integer to the stream with variable length encoding. More...
 
void WriteInt32VarLength (int value, int blockSize)
 Writes a 32-bit signed integer to the stream with variable length encoding and a specified block size. More...
 
void WriteUInt64VarLength (ulong value, int blockSize)
 Writes a 64-bit unsigned integer to the stream with variable length encoding and a specified block size. More...
 

Properties

int OffsetBits [get]
 Gets the current offset in bits. More...
 

Detailed Description

Interface for writing bits to a stream.

Member Function Documentation

◆ WriteBoolean()

bool WriteBoolean ( bool  b)

Writes a boolean value to the stream.

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

Implemented in NetBitBuffer, and NetBitBufferNull.

◆ WriteBytesAligned() [1/2]

void WriteBytesAligned ( Span< byte >  buffer)

Writes a sequence of bytes to the stream, aligned to byte boundaries.

Parameters
bufferA pointer to the buffer containing the bytes to write.

Implemented in NetBitBufferNull, and NetBitBuffer.

◆ WriteBytesAligned() [2/2]

void WriteBytesAligned ( void *  buffer,
int  length 
)

Writes a sequence of bytes to the stream, aligned to byte boundaries.

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

Implemented in NetBitBufferNull, and NetBitBuffer.

◆ WriteInt32()

void WriteInt32 ( int  value,
int  bits = 32 
)

Writes a 32-bit signed integer to the stream.

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

Implemented in NetBitBufferNull, and NetBitBuffer.

◆ WriteInt32VarLength() [1/2]

void WriteInt32VarLength ( int  value)

Writes a 32-bit signed integer to the stream with variable length encoding.

Parameters
valueThe 32-bit signed integer value to write.

Implemented in NetBitBufferNull, and NetBitBuffer.

◆ WriteInt32VarLength() [2/2]

void WriteInt32VarLength ( int  value,
int  blockSize 
)

Writes a 32-bit signed integer to the stream with variable length encoding and a specified block size.

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

Implemented in NetBitBufferNull, and NetBitBuffer.

◆ WriteUInt64VarLength()

void WriteUInt64VarLength ( ulong  value,
int  blockSize 
)

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

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

Implemented in NetBitBufferNull, and NetBitBuffer.

Property Documentation

◆ OffsetBits

int OffsetBits
get

Gets the current offset in bits.