Skip to content

Class Lidgren::Network::NetBitWriter

ClassList > Lidgren > Network > NetBitWriter

Helper class for NetBuffer to write/read bits.

Public Static Functions

Type Name
byte ReadByte (byte[] fromBuffer, int numberOfBits, int readBitOffset)
Read 1-8 bits from a buffer into a byte.
void ReadBytes (byte[] fromBuffer, int numberOfBytes, int readBitOffset, byte[] destination, int destinationByteOffset)
Read several bytes from a buffer.
ushort ReadUInt16 (byte[] fromBuffer, int numberOfBits, int readBitOffset)
Reads an unsigned 16 bit integer.
uint ReadUInt32 (byte[] fromBuffer, int numberOfBits, int readBitOffset)
Reads the specified number of bits into an UInt32.
uint ReadVariableUInt32 (byte[] buffer, ref int offset)
Reads a UInt32 written using WriteUnsignedVarInt(); will increment offset!
void WriteByte (byte source, int numberOfBits, byte[] destination, int destBitOffset)
Write 0-8 bits of data to buffer.
void WriteBytes (byte[] source, int sourceByteOffset, int numberOfBytes, byte[] destination, int destBitOffset)
Write several whole bytes.
void WriteUInt16 (ushort source, int numberOfBits, byte[] destination, int destinationBitOffset)
Writes an unsigned 16 bit integer.
int WriteUInt32 (uint source, int numberOfBits, byte[] destination, int destinationBitOffset)
Writes the specified number of bits into a byte array.
int WriteUInt64 (ulong source, int numberOfBits, byte[] destination, int destinationBitOffset)
Writes the specified number of bits into a byte array.
int WriteVariableUInt32 (byte[] intoBuffer, int offset, uint value)
Write Base128 encoded variable sized unsigned integer.

Public Static Functions Documentation

function ReadByte

static inline byte Lidgren::Network::NetBitWriter::ReadByte (
    byte[] fromBuffer,
    int numberOfBits,
    int readBitOffset
) 

function ReadBytes

static inline void Lidgren::Network::NetBitWriter::ReadBytes (
    byte[] fromBuffer,
    int numberOfBytes,
    int readBitOffset,
    byte[] destination,
    int destinationByteOffset
) 

function ReadUInt16

static inline ushort Lidgren::Network::NetBitWriter::ReadUInt16 (
    byte[] fromBuffer,
    int numberOfBits,
    int readBitOffset
) 

function ReadUInt32

static inline uint Lidgren::Network::NetBitWriter::ReadUInt32 (
    byte[] fromBuffer,
    int numberOfBits,
    int readBitOffset
) 

function ReadVariableUInt32

static inline uint Lidgren::Network::NetBitWriter::ReadVariableUInt32 (
    byte[] buffer,
    ref int offset
) 

function WriteByte

static inline void Lidgren::Network::NetBitWriter::WriteByte (
    byte source,
    int numberOfBits,
    byte[] destination,
    int destBitOffset
) 

function WriteBytes

static inline void Lidgren::Network::NetBitWriter::WriteBytes (
    byte[] source,
    int sourceByteOffset,
    int numberOfBytes,
    byte[] destination,
    int destBitOffset
) 

function WriteUInt16

static inline void Lidgren::Network::NetBitWriter::WriteUInt16 (
    ushort source,
    int numberOfBits,
    byte[] destination,
    int destinationBitOffset
) 

function WriteUInt32

static inline int Lidgren::Network::NetBitWriter::WriteUInt32 (
    uint source,
    int numberOfBits,
    byte[] destination,
    int destinationBitOffset
) 

function WriteUInt64

static inline int Lidgren::Network::NetBitWriter::WriteUInt64 (
    ulong source,
    int numberOfBits,
    byte[] destination,
    int destinationBitOffset
) 

function WriteVariableUInt32

Write Base128 encoded variable sized unsigned integer.

static inline int Lidgren::Network::NetBitWriter::WriteVariableUInt32 (
    byte[] intoBuffer,
    int offset,
    uint value
) 

Returns:

number of bytes written


The documentation for this class was generated from the following file api/unity-plugin/Scripts/Networking/Lidgren.Network/NetBitWriter.cs