C# Class Lidgren.Network.NetBitWriter

Helper class for NetBuffer to write/read bits
Afficher le fichier Open project: tomoprime/CrabBattle Class Usage Examples

Méthodes publiques

Méthode Description
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

Method Details

ReadByte() public static méthode

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
Résultat byte

ReadBytes() public static méthode

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
Résultat void

ReadUInt32() public static méthode

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
Résultat uint

ReadVariableUInt32() public static méthode

Reads a UInt32 written using WriteUnsignedVarInt(); will increment offset!
public static ReadVariableUInt32 ( byte buffer, int &offset ) : uint
buffer byte
offset int
Résultat uint

WriteByte() public static méthode

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
Résultat void

WriteBytes() public static méthode

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
Résultat void

WriteUInt32() public static méthode

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
Résultat int

WriteUInt64() public static méthode

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
Résultat int

WriteVariableUInt32() public static méthode

Write Base128 encoded variable sized unsigned integer
public static WriteVariableUInt32 ( byte intoBuffer, int offset, uint value ) : int
intoBuffer byte
offset int
value uint
Résultat int