Click or drag to resize

NetDataReader Class

Inheritance Hierarchy
SystemObject
  LiteNetLib.UtilsNetDataReader
    LiteNetLibNetPacketReader

Namespace: LiteNetLib.Utils
Assembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.2.1.0 (2026.2.1.0)
Syntax
C#
public class NetDataReader

The NetDataReader type exposes the following members.

Constructors
 NameDescription
Public methodNetDataReaderInitializes a new instance of the NetDataReader class
Public methodNetDataReader(Byte)Initializes a new instance of the NetDataReader class
Public methodNetDataReader(NetDataWriter)Initializes a new instance of the NetDataReader class
Public methodNetDataReader(Byte, Int32, Int32)Initializes a new instance of the NetDataReader class
Top
Properties
 NameDescription
Public propertyAvailableBytes Gets the number of Bytes remaining to be read.
Public propertyEndOfData Gets a value indicating whether the Position has reached the end of the data.
Public propertyIsNull Gets a value indicating whether the internal data buffer is .
Public propertyPosition Gets the current read position within the buffer.
Public propertyRawData Gets the internal Byte array containing the raw network data.
Public propertyRawDataSize Gets the total size of the RawData buffer.
Public propertyUserDataOffset Gets the starting offset of the user payload within the RawData.
Public propertyUserDataSize Gets the size of the user payload excluding the initial UserDataOffset.
Top
Methods
 NameDescription
Public methodClearClears the reader state and releases the reference to the internal buffer.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGet(Boolean)Reads a Boolean and assigns it to result.
Public methodGet(Byte)Reads a Byte and assigns it to result.
Public methodGet(Char)Reads a Char and assigns it to result.
Public methodGet(Double)Reads a Double and assigns it to result.
Public methodGet(Guid)Reads a Guid and assigns it to result.
Public methodGet(Int16)Reads a Int16 and assigns it to result.
Public methodGet(Int32)Reads an Int32 and assigns it to result.
Public methodGet(Int64)Reads a Int64 and assigns it to result.
Public methodGet(IPEndPoint) Deserializes an IPEndPoint and assigns it to the result parameter.
Public methodGet(SByte)Reads an SByte and assigns it to result.
Public methodGet(Single)Reads a Single and assigns it to result.
Public methodGet(String)Reads a String and assigns it to result.
Public methodGet(UInt16)Reads a UInt16 and assigns it to result.
Public methodGet(UInt32)Reads a UInt32 and assigns it to result.
Public methodGet(UInt64)Reads a UInt64 and assigns it to result.
Public methodGet(String, Int32)Reads a String with a length limit and assigns it to result.
Public methodGetT Deserializes a struct that implements INetSerializable.
Public methodGetT(FuncT) Deserializes a class that implements INetSerializable using a provided constructor.
Public methodGetT(T) Deserializes a struct that implements INetSerializable.
Public methodGetT(T, FuncT) Deserializes a class that implements INetSerializable using a provided constructor.
Public methodGetArrayT Reads an array of objects implementing INetSerializable.
Public methodGetArrayT(FuncT) Reads an array of objects implementing INetSerializable using a specific constructor.
Public methodGetArrayT(UInt16) Reads an array of values by performing a direct memory copy.
Public methodGetBoolReads a Boolean value from the current position.
Public methodGetBoolArrayReads an array of Boolean values.
Public methodGetByteReads the next Byte from the buffer.
Public methodGetBytes(Byte, Int32) Copies a specified number of Bytes into a destination array starting at index 0.
Public methodGetBytes(Byte, Int32, Int32) Copies a specified number of Bytes into a destination array at a specific offset.
Public methodGetBytesSegment Gets an ArraySegmentT of Bytes from the current position.
Public methodGetBytesWithLength Reads a Byte array prefixed with its UInt16 length.
Public methodGetCharReads a Char value as a 2-byte UInt16.
Public methodGetDoubleReads a Double value using unmanaged memory access.
Public methodGetDoubleArrayReads an array of Double values.
Public methodGetEnumT Reads an enum value of type T from the internal data buffer at the current position.
Advances the position by the size of T.
Public methodGetFloatReads a Single value using unmanaged memory access.
Public methodGetFloatArrayReads an array of Single values.
Public methodGetGuid Reads a 16-byte Guid.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetIntReads an Int32 value using unmanaged memory access.
Public methodGetIntArrayReads an array of Int32 values.
Public methodGetIPEndPoint Reads an IPEndPoint from the current Position.
Public methodGetLargeString Reads a String prefixed with a 4-byte Int32 length header.
Public methodGetLongReads a Int64 value using unmanaged memory access.
Public methodGetLongArrayReads an array of Int64 values.
Public methodGetNullableUnmanagedT Reads a nullable value of type T from the internal byte buffer at the current position, first reading a Boolean indicating whether the value is present, and then reading the value itself if it exists.
Advances the position by 1 byte for the presence flag plus the size of T if the value is present.
Public methodGetRemainingBytes Reads all remaining Bytes and returns them as a new array.
Public methodGetRemainingBytesMemory Returns a ReadOnlyMemoryT of Bytes containing all remaining data.
Public methodGetRemainingBytesSegment Gets an ArraySegmentT containing all remaining Bytes.
Public methodGetRemainingBytesSpan Returns a ReadOnlySpanT of Bytes containing all remaining data.
Public methodGetSByteReads the next SByte from the buffer.
Public methodGetSBytesWithLength Reads an SByte array prefixed with its UInt16 length.
Public methodGetShortReads a Int16 value using unmanaged memory access.
Public methodGetShortArrayReads an array of Int16 values.
Public methodGetString Reads a String from the current position.
Public methodGetString(Int32) Reads a String with a maximum character limit.
Public methodGetStringArray Reads an array of String values.
Public methodGetStringArray(Int32) Reads an array of String values with a maximum character limit per element.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodGetUIntReads a UInt32 value using unmanaged memory access.
Public methodGetUIntArrayReads an array of UInt32 values.
Public methodGetULongReads a UInt64 value using unmanaged memory access.
Public methodGetULongArrayReads an array of UInt64 values.
Public methodGetUnmanagedT Reads a value of type T from the internal byte buffer at the current position, advancing the position by the size of T.
Public methodGetUnmanagedArrayT Reads an array of unmanaged values prefixed by a UInt16 length.
Public methodGetUShortReads a UInt16 value using unmanaged memory access.
Public methodGetUShortArrayReads an array of UInt16 values.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodPeekBoolReads the Boolean at the current position without advancing the Position.
Public methodPeekByteReads the Byte at the current position without advancing the Position.
Public methodPeekCharReads the Char at the current position without advancing the Position.
Public methodPeekDoubleReads the Double at the current position without advancing the Position.
Public methodPeekFloatReads the Single at the current position without advancing the Position.
Public methodPeekIntReads the Int32 at the current position without advancing the Position.
Public methodPeekLongReads the Int64 at the current position without advancing the Position.
Public methodPeekRemainingBytes Reads all remaining Bytes and returns them as a new array without advancing the reader _position.
Public methodPeekRemainingBytesMemory Returns a ReadOnlyMemoryT of Bytes containing all remaining data without advancing the reader _position.
Public methodPeekRemainingBytesSpan Returns a ReadOnlySpanT of Bytes containing all remaining data without advancing the reader _position.
Public methodPeekSByteReads the SByte at the current position without advancing the Position.
Public methodPeekShortReads the Int16 at the current position without advancing the Position.
Public methodPeekString Reads a String without advancing the Position.
Public methodPeekString(Int32) Reads a String with a character limit without advancing the Position.
Public methodPeekUIntReads the UInt32 at the current position without advancing the Position.
Public methodPeekULongReads the UInt64 at the current position without advancing the Position.
Public methodPeekUnmanagedT Reads an unmanaged value of type T at the current position without advancing the Position.
Public methodPeekUShortReads the UInt16 at the current position without advancing the Position.
Public methodSetPosition Sets the current read Position to a specific index.
Public methodSetSource(Byte) Reinitializes the reader using a Byte array.
Public methodSetSource(NetDataWriter) Reinitializes the reader using data from a NetDataWriter.
Public methodSetSource(Byte, Int32, Int32) Reinitializes the reader using a segment of a Byte array.
Public methodSkipBytes Advances the Position by the specified count.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodTryGetBoolAttempts to read a Boolean without throwing an exception.
Public methodTryGetByteAttempts to read a Byte without throwing an exception.
Public methodTryGetBytesWithLengthAttempts to read a Byte array with a length header without throwing an exception.
Public methodTryGetCharAttempts to read a Char without throwing an exception.
Public methodTryGetDoubleAttempts to read a Double without throwing an exception.
Public methodTryGetFloatAttempts to read a Single without throwing an exception.
Public methodTryGetIntAttempts to read an Int32 without throwing an exception.
Public methodTryGetLongAttempts to read a Int64 without throwing an exception.
Public methodTryGetSByteAttempts to read an SByte without throwing an exception.
Public methodTryGetShortAttempts to read a Int16 without throwing an exception.
Public methodTryGetStringAttempts to read a String without throwing an exception.
Public methodTryGetStringArrayAttempts to read a String array without throwing an exception.
Public methodTryGetUIntAttempts to read a UInt32 without throwing an exception.
Public methodTryGetULongAttempts to read a UInt64 without throwing an exception.
Public methodTryGetUnmanagedT Attempts to read a value of type T from the internal byte buffer at the current position, advancing the position by the size of T if successful.
Public methodTryGetUShortAttempts to read a UInt16 without throwing an exception.
Top
Fields
 NameDescription
Protected field_data 
Protected field_dataSize 
Protected field_offset 
Protected field_position 
Top
Extension Methods
 NameDescription
Public Extension MethodMethodInvoke Calls the object method by name.
(Defined by ObjectEx)
Public Extension MethodPropertyGet Gets the value of the object property by name.
(Defined by ObjectEx)
Public Extension MethodPropertyGetT Gets the value of the object property by name.
(Defined by ObjectEx)
Public Extension MethodPropertySet Sets the value of the object property by name.
(Defined by ObjectEx)
Top
See Also