Photon Fusion 2.1.1

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

Properties

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

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 NetBitBuffer, and NetBitBufferNull.

◆ 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 NetBitBuffer, and NetBitBufferNull.

◆ 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 NetBitBuffer, and NetBitBufferNull.

◆ 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 NetBitBuffer, and NetBitBufferNull.

◆ 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 NetBitBuffer, and NetBitBufferNull.

◆ 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 NetBitBuffer, and NetBitBufferNull.