C# Класс Lidgren.Network.NetBitWriter

Helper class for NetBuffer to write/read bits
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ReadByte ( byte fromBuffer, int numberOfBits, int readBitOffset ) : byte

Read 1-8 bits from a buffer into a byte

ReadBytes ( byte fromBuffer, int numberOfBytes, int readBitOffset, byte destination, int destinationByteOffset ) : void

Read several bytes from a buffer

ReadUInt32 ( byte fromBuffer, int numberOfBits, int readBitOffset ) : uint

Reads the specified number of bits into an UInt32

ReadVariableUInt32 ( byte buffer, int &offset ) : uint

Reads a UInt32 written using WriteUnsignedVarInt(); will increment offset!

WriteByte ( byte source, int numberOfBits, byte destination, int destBitOffset ) : void

Write a byte consisting of 1-8 bits to a buffer; assumes buffer is previously allocated

WriteBytes ( byte source, int sourceByteOffset, int numberOfBytes, byte destination, int destBitOffset ) : void

Write several whole bytes

WriteUInt32 ( uint source, int numberOfBits, byte destination, int destinationBitOffset ) : int

Writes the specified number of bits into a byte array

WriteUInt64 ( ulong source, int numberOfBits, byte destination, int destinationBitOffset ) : int

Writes the specified number of bits into a byte array

WriteVariableUInt32 ( byte intoBuffer, int offset, uint value ) : int

Write Base128 encoded variable sized unsigned integer

Описание методов

ReadByte() публичный статический Метод

Read 1-8 bits from a buffer into a byte
public static ReadByte ( byte fromBuffer, int numberOfBits, int readBitOffset ) : byte
fromBuffer byte
numberOfBits int
readBitOffset int
Результат byte

ReadBytes() публичный статический Метод

Read several bytes from a buffer
public static ReadBytes ( byte fromBuffer, int numberOfBytes, int readBitOffset, byte destination, int destinationByteOffset ) : void
fromBuffer byte
numberOfBytes int
readBitOffset int
destination byte
destinationByteOffset int
Результат void

ReadUInt32() публичный статический Метод

Reads the specified number of bits into an UInt32
public static ReadUInt32 ( byte fromBuffer, int numberOfBits, int readBitOffset ) : uint
fromBuffer byte
numberOfBits int
readBitOffset int
Результат uint

ReadVariableUInt32() публичный статический Метод

Reads a UInt32 written using WriteUnsignedVarInt(); will increment offset!
public static ReadVariableUInt32 ( byte buffer, int &offset ) : uint
buffer byte
offset int
Результат uint

WriteByte() публичный статический Метод

Write a byte consisting of 1-8 bits to a buffer; assumes buffer is previously allocated
public static WriteByte ( byte source, int numberOfBits, byte destination, int destBitOffset ) : void
source byte
numberOfBits int
destination byte
destBitOffset int
Результат void

WriteBytes() публичный статический Метод

Write several whole bytes
public static WriteBytes ( byte source, int sourceByteOffset, int numberOfBytes, byte destination, int destBitOffset ) : void
source byte
sourceByteOffset int
numberOfBytes int
destination byte
destBitOffset int
Результат void

WriteUInt32() публичный статический Метод

Writes the specified number of bits into a byte array
public static WriteUInt32 ( uint source, int numberOfBits, byte destination, int destinationBitOffset ) : int
source uint
numberOfBits int
destination byte
destinationBitOffset int
Результат int

WriteUInt64() публичный статический Метод

Writes the specified number of bits into a byte array
public static WriteUInt64 ( ulong source, int numberOfBits, byte destination, int destinationBitOffset ) : int
source ulong
numberOfBits int
destination byte
destinationBitOffset int
Результат int

WriteVariableUInt32() публичный статический Метод

Write Base128 encoded variable sized unsigned integer
public static WriteVariableUInt32 ( byte intoBuffer, int offset, uint value ) : int
intoBuffer byte
offset int
value uint
Результат int