Click or drag to resize

NetBuffer Class

Base class for NetIncomingMessage and NetOutgoingMessage
Inheritance Hierarchy

Namespace:  Internal.Lidgren.Network
Assembly:  NeoAxis.Core (in NeoAxis.Core.dll) Version: 2024.1.1.0 (2024.1.1.0)
Syntax
C#
public class NetBuffer

The NetBuffer type exposes the following members.

Constructors
  NameDescription
Public methodNetBuffer
Initializes a new instance of the NetBuffer class
Top
Properties
  NameDescription
Public propertyData
Gets or sets the internal data buffer
Public propertyLengthBits
Gets or sets the length of the used portion of the buffer in bits
Public propertyLengthBytes
Gets or sets the length of the used portion of the buffer in bytes
Public propertyPosition
Gets or sets the read position in the buffer, in bits (not bytes)
Public propertyPositionInBytes
Gets the position in the buffer in bytes; note that the bits of the first returned byte may already have been read - check the Position property to make sure.
Top
Methods
  NameDescription
Public methodEnsureBufferSize
Ensures the buffer can hold this number of bits
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPeekBoolean
Reads a 1-bit Boolean without advancing the read pointer
Public methodPeekByte
Reads a Byte without advancing the read pointer
Public methodPeekByte(Int32)
Reads the specified number of bits into a Byte without advancing the read pointer
Public methodPeekBytes(Int32)
Reads the specified number of bytes without advancing the read pointer
Public methodPeekBytes(Void)
Public methodPeekBytes(Byte, Int32, Int32)
Reads the specified number of bytes without advancing the read pointer
Public methodPeekDataBuffer
Gets the internal data buffer
Public methodPeekDouble
Reads a 64-bit Double without advancing the read pointer
Public methodPeekFloat
Reads a 32-bit Single without advancing the read pointer
Public methodPeekHalf
Writes a 16 bit floating point value
Public methodPeekInt16
Reads an Int16 without advancing the read pointer
Public methodPeekInt32
Reads an Int32 without advancing the read pointer
Public methodPeekInt32(Int32)
Reads the specified number of bits into an Int32 without advancing the read pointer
Public methodPeekInt64
Reads an Int64 without advancing the read pointer
Public methodPeekInt64(Int32)
Reads the specified number of bits into an Int64 without advancing the read pointer
Public methodPeekSByte
Reads an SByte without advancing the read pointer
Public methodPeekSingle
Reads a 32-bit Single without advancing the read pointer
Public methodPeekString
Reads a string without advancing the read pointer
Public methodPeekStringSize
Reads the string byte size prefix without advancing the read pointer. Take note that this is the size in bytes, not the character length of the string.
Public methodPeekUInt16
Reads a UInt16 without advancing the read pointer
Public methodPeekUInt32
Reads a UInt32 without advancing the read pointer
Public methodPeekUInt32(Int32)
Reads the specified number of bits into a UInt32 without advancing the read pointer
Public methodPeekUInt64
Reads a UInt64 without advancing the read pointer
Public methodPeekUInt64(Int32)
Reads the specified number of bits into an UInt64 without advancing the read pointer
Public methodReadBits(Span, Void)
Public methodReadBits(Byte, Int32, Int32)
Reads the specified number of bits into a preallocated array
Public methodReadBoolean
Reads a boolean value (stored as a single bit) written using Write(bool)
Public methodReadByte
Reads a byte
Public methodReadByte(Byte)
Reads a byte and returns true or false for success
Public methodReadByte(Int32)
Reads 1 to 8 bits into a byte
Public methodReadBytes(Int32)
Reads the specified number of bytes
Public methodReadBytes(Void)
Public methodReadBytes(Int32, Byte)
Reads the specified number of bytes and returns true for success
Public methodReadBytes(Byte, Int32, Int32)
Reads the specified number of bytes into a preallocated array
Public methodReadDouble
Reads a 64 bit floating point value written using Write(Double)
Public methodReadFloat
Reads a 32 bit floating point value written using Write(Single)
Public methodReadHalf
Reads a 16 bit floating point value written using Write(Half)
Public methodReadInt16
Reads a 16 bit signed integer written using Write(Int16)
Public methodReadInt32
Reads a 32 bit signed integer written using Write(Int32)
Public methodReadInt32(Int32)
Reads a signed integer stored in 1 to 32 bits, written using Write(Int32, Int32)
Public methodReadInt32(Int32)
Reads a 32 bit signed integer written using Write(Int32)
Public methodReadInt64
Reads a 64 bit signed integer written using Write(Int64)
Public methodReadInt64(Int32)
Reads a signed integer stored in 1 to 64 bits, written using Write(Int64, Int32)
Public methodReadIPEndPoint
Reads a stored IPv4 endpoint description
Public methodReadPadBits
Pads data with enough bits to reach a full byte. Decreases cpu usage for subsequent byte writes.
Public methodReadRangedInteger(Int32, Int32)
Reads a 32 bit integer value written using WriteRangedInteger()
Public methodReadRangedInteger(Int64, Int64)
Reads a 64 bit integer value written using WriteRangedInteger() (64 version)
Public methodReadRangedSingle
Reads a 32 bit floating point value written using WriteRangedSingle()
Public methodReadSByte
Reads a signed byte
Public methodReadSignedSingle
Reads a 32 bit floating point value written using WriteSignedSingle()
Public methodReadSingle
Reads a 32 bit floating point value written using Write(Single)
Public methodReadSingle(Single)
Reads a 32 bit floating point value written using Write(Single)
Public methodReadString
Reads a string written using Write(string)
Public methodReadString(String)
Reads a string written using Write(string) and returns true for success
Public methodReadTime
Reads a value, in local time comparable to NetTime.Now, written using WriteTime() for the connection supplied
Public methodReadUInt16
Reads a 16 bit unsigned integer written using Write(UInt16)
Public methodReadUInt32
Reads an 32 bit unsigned integer written using Write(UInt32)
Public methodReadUInt32(Int32)
Reads an unsigned integer stored in 1 to 32 bits, written using Write(UInt32, Int32)
Public methodReadUInt32(UInt32)
Reads an 32 bit unsigned integer written using Write(UInt32) and returns true for success
Public methodReadUInt64
Reads a 64 bit unsigned integer written using Write(UInt64)
Public methodReadUInt64(Int32)
Reads an unsigned integer stored in 1 to 64 bits, written using Write(UInt64, Int32)
Public methodReadUnitSingle
Reads a 32 bit floating point value written using WriteUnitSingle()
Public methodReadVariableInt32
Reads a variable sized Int32 written using WriteVariableInt32()
Public methodReadVariableInt64
Reads a variable sized Int64 written using WriteVariableInt64()
Public methodReadVariableUInt32
Reads a variable sized UInt32 written using WriteVariableUInt32()
Public methodReadVariableUInt32(UInt32)
Reads a variable sized UInt32 written using WriteVariableUInt32() and returns true for success
Public methodReadVariableUInt32WithBytesReaded
Reads a variable sized UInt32 written using WriteVariableUInt32()
Public methodReadVariableUInt64
Reads a variable sized UInt32 written using WriteVariableInt64()
Public methodSkipPadBits
Pads data with enough bits to reach a full byte. Decreases cpu usage for subsequent byte writes.
Public methodSkipPadBits(Int32)
Pads data with the specified number of bits.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTryReadBytes
Public methodWrite(Boolean)
Writes a boolean value using 1 bit
Public methodWrite(Byte)
Write a byte
Public methodWrite(Byte)
Writes all bytes in an array
Public methodWrite(Double)
Writes a 64 bit floating point value
Public methodWrite(Half)
Writes a 16 bit floating point value
Public methodWrite(Int16)
Writes a signed 16 bit integer
Public methodWrite(Int32)
Writes a 32 bit signed integer
Public methodWrite(Int64)
Writes a 64 bit signed integer
Public methodWrite(IPEndPoint)
Writes an endpoint description
Public methodWrite(ReadOnlySpan)
Public methodWrite(SByte)
Writes a signed byte
Public methodWrite(Single)
Writes a 32 bit floating point value
Public methodWrite(String)
Write a string
Public methodWrite(UInt16)
Writes an unsigned 16 bit integer
Public methodWrite(UInt32)
Writes a 32 bit unsigned integer
Public methodWrite(UInt64)
Writes a 64 bit unsigned integer
Public methodWrite(NetBuffer)
Append all the bits of message to this message
Public methodWrite(Byte, Int32)
Writes 1 to 8 bits of a byte
Public methodWrite(Int32, Int32)
Writes a signed integer using 1 to 32 bits
Public methodWrite(Int64, Int32)
Writes a signed integer using 1 to 64 bits
Public methodWrite(UInt16, Int32)
Writes an unsigned integer using 1 to 16 bits
Public methodWrite(UInt32, Int32)
Writes a 32 bit signed integer
Public methodWrite(UInt64, Int32)
Writes an unsigned integer using 1 to 64 bits
Public methodWrite(Byte, Int32, Int32)
Writes the specified number of bytes from an array
Public methodWriteAt(Int32, Byte)
Writes a byte at a given offset in the buffer
Public methodWriteAt(Int32, Int16)
Writes a 16 bit signed integer at a given offset in the buffer
Public methodWriteAt(Int32, Int32)
Writes a 32 bit signed integer at a given offset in the buffer
Public methodWriteAt(Int32, UInt16)
Writes a 16 bit unsigned integer at a given offset in the buffer
Public methodWriteAt(Int32, UInt32)
Writes a 32 bit unsigned integer at a given offset in the buffer
Public methodWriteAt(Int32, UInt64)
Writes a 64 bit unsigned integer at a given offset in the buffer
Public methodWritePadBits
Pads data with enough bits to reach a full byte. Decreases cpu usage for subsequent byte writes.
Public methodWritePadBits(Int32)
Pads data with the specified number of bits.
Public methodWriteRangedInteger(Int32, Int32, Int32)
Writes an integer with the least amount of bits need for the specified range Returns number of bits written
Public methodWriteRangedInteger(Int64, Int64, Int64)
Writes an integer with the least amount of bits need for the specified range Returns number of bits written
Public methodWriteRangedSingle
Compress a float within a specified range using a certain number of bits
Public methodWriteSignedSingle
Compress (lossy) a float in the range -1..1 using numberOfBits bits
Public methodWriteTime(Boolean)
Writes the current local time to a message; readable (and convertable to local time) by the remote host using ReadTime()
Public methodWriteTime(Double, Boolean)
Writes a local timestamp to a message; readable (and convertable to local time) by the remote host using ReadTime()
Public methodWriteUnitSingle
Compress (lossy) a float in the range 0..1 using numberOfBits bits
Public methodWriteVariableInt32
Write Base128 encoded variable sized signed integer of up to 32 bits
Public methodWriteVariableInt64
Write Base128 encoded variable sized signed integer of up to 64 bits
Public methodWriteVariableUInt32
Write Base128 encoded variable sized unsigned integer of up to 32 bits
Public methodWriteVariableUInt64
Write Base128 encoded variable sized unsigned integer of up to 64 bits
Public methodZero
Writes a number of zeroed bytes
Top
Fields
  NameDescription
Protected fieldStatic memberc_overAllocateAmount
Number of bytes to overallocate for each message to avoid resizing
Top
Extension Methods
See Also