Class NetDataReader
Inheritance
System.Object
NetDataReader
Assembly: LiteNetLib.dll
Syntax
public class NetDataReader
Constructors
NetDataReader()
Declaration
NetDataReader(Byte[])
Declaration
public NetDataReader(byte[] source)
Parameters
Type |
Name |
Description |
System.Byte[] |
source |
|
NetDataReader(Byte[], Int32)
Declaration
public NetDataReader(byte[] source, int offset)
Parameters
Type |
Name |
Description |
System.Byte[] |
source |
|
System.Int32 |
offset |
|
NetDataReader(Byte[], Int32, Int32)
Declaration
public NetDataReader(byte[] source, int offset, int maxSize)
Parameters
Type |
Name |
Description |
System.Byte[] |
source |
|
System.Int32 |
offset |
|
System.Int32 |
maxSize |
|
Fields
_data
Declaration
Field Value
Type |
Description |
System.Byte[] |
|
_dataSize
Declaration
Field Value
Type |
Description |
System.Int32 |
|
_position
Declaration
Field Value
Type |
Description |
System.Int32 |
|
Properties
AvailableBytes
Declaration
public int AvailableBytes { get; }
Property Value
Type |
Description |
System.Int32 |
|
EndOfData
Declaration
public bool EndOfData { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsNull
Declaration
public bool IsNull { get; }
Property Value
Type |
Description |
System.Boolean |
|
Position
Declaration
public int Position { get; }
Property Value
Type |
Description |
System.Int32 |
|
RawData
Declaration
public byte[] RawData { get; }
Property Value
Type |
Description |
System.Byte[] |
|
RawDataSize
Declaration
public int RawDataSize { get; }
Property Value
Type |
Description |
System.Int32 |
|
UserDataOffset
Declaration
public int UserDataOffset { get; }
Property Value
Type |
Description |
System.Int32 |
|
UserDataSize
Declaration
public int UserDataSize { get; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
Clear()
Declaration
Get<T>()
Declaration
public T Get<T>()
where T : INetSerializable, new()
Returns
Type Parameters
GetBool()
Declaration
Returns
Type |
Description |
System.Boolean |
|
GetBoolArray()
Declaration
public bool[] GetBoolArray()
Returns
Type |
Description |
System.Boolean[] |
|
GetByte()
Declaration
Returns
Type |
Description |
System.Byte |
|
GetBytes(Byte[], Int32)
Declaration
public void GetBytes(byte[] destination, int count)
Parameters
Type |
Name |
Description |
System.Byte[] |
destination |
|
System.Int32 |
count |
|
GetBytes(Byte[], Int32, Int32)
Declaration
public void GetBytes(byte[] destination, int start, int count)
Parameters
Type |
Name |
Description |
System.Byte[] |
destination |
|
System.Int32 |
start |
|
System.Int32 |
count |
|
GetBytesWithLength()
Declaration
public byte[] GetBytesWithLength()
Returns
Type |
Description |
System.Byte[] |
|
GetChar()
Declaration
Returns
Type |
Description |
System.Char |
|
GetDouble()
Declaration
public double GetDouble()
Returns
Type |
Description |
System.Double |
|
GetDoubleArray()
Declaration
public double[] GetDoubleArray()
Returns
Type |
Description |
System.Double[] |
|
GetFloat()
Declaration
Returns
Type |
Description |
System.Single |
|
GetFloatArray()
Declaration
public float[] GetFloatArray()
Returns
Type |
Description |
System.Single[] |
|
GetInt()
Declaration
Returns
Type |
Description |
System.Int32 |
|
GetIntArray()
Declaration
public int[] GetIntArray()
Returns
Type |
Description |
System.Int32[] |
|
GetLong()
Declaration
Returns
Type |
Description |
System.Int64 |
|
GetLongArray()
Declaration
public long[] GetLongArray()
Returns
Type |
Description |
System.Int64[] |
|
GetNetEndPoint()
Declaration
public IPEndPoint GetNetEndPoint()
Returns
Type |
Description |
System.Net.IPEndPoint |
|
GetRemainingBytes()
Declaration
public byte[] GetRemainingBytes()
Returns
Type |
Description |
System.Byte[] |
|
GetRemainingBytesSegment()
Declaration
public ArraySegment<byte> GetRemainingBytesSegment()
Returns
Type |
Description |
System.ArraySegment<System.Byte> |
|
GetSByte()
Declaration
Returns
Type |
Description |
System.SByte |
|
GetSBytesWithLength()
Declaration
public sbyte[] GetSBytesWithLength()
Returns
Type |
Description |
System.SByte[] |
|
GetShort()
Declaration
Returns
Type |
Description |
System.Int16 |
|
GetShortArray()
Declaration
public short[] GetShortArray()
Returns
Type |
Description |
System.Int16[] |
|
GetString()
Declaration
public string GetString()
Returns
Type |
Description |
System.String |
|
GetString(Int32)
Declaration
public string GetString(int maxLength)
Parameters
Type |
Name |
Description |
System.Int32 |
maxLength |
|
Returns
Type |
Description |
System.String |
|
GetStringArray()
Declaration
public string[] GetStringArray()
Returns
Type |
Description |
System.String[] |
|
GetStringArray(Int32)
Declaration
public string[] GetStringArray(int maxStringLength)
Parameters
Type |
Name |
Description |
System.Int32 |
maxStringLength |
|
Returns
Type |
Description |
System.String[] |
|
GetUInt()
Declaration
Returns
Type |
Description |
System.UInt32 |
|
GetUIntArray()
Declaration
public uint[] GetUIntArray()
Returns
Type |
Description |
System.UInt32[] |
|
GetULong()
Declaration
Returns
Type |
Description |
System.UInt64 |
|
GetULongArray()
Declaration
public ulong[] GetULongArray()
Returns
Type |
Description |
System.UInt64[] |
|
GetUShort()
Declaration
public ushort GetUShort()
Returns
Type |
Description |
System.UInt16 |
|
GetUShortArray()
Declaration
public ushort[] GetUShortArray()
Returns
Type |
Description |
System.UInt16[] |
|
PeekBool()
Declaration
Returns
Type |
Description |
System.Boolean |
|
PeekByte()
Declaration
Returns
Type |
Description |
System.Byte |
|
PeekChar()
Declaration
Returns
Type |
Description |
System.Char |
|
PeekDouble()
Declaration
public double PeekDouble()
Returns
Type |
Description |
System.Double |
|
PeekFloat()
Declaration
Returns
Type |
Description |
System.Single |
|
PeekInt()
Declaration
Returns
Type |
Description |
System.Int32 |
|
PeekLong()
Declaration
Returns
Type |
Description |
System.Int64 |
|
PeekSByte()
Declaration
Returns
Type |
Description |
System.SByte |
|
PeekShort()
Declaration
Returns
Type |
Description |
System.Int16 |
|
PeekString()
Declaration
public string PeekString()
Returns
Type |
Description |
System.String |
|
PeekString(Int32)
Declaration
public string PeekString(int maxLength)
Parameters
Type |
Name |
Description |
System.Int32 |
maxLength |
|
Returns
Type |
Description |
System.String |
|
PeekUInt()
Declaration
Returns
Type |
Description |
System.UInt32 |
|
PeekULong()
Declaration
Returns
Type |
Description |
System.UInt64 |
|
PeekUShort()
Declaration
public ushort PeekUShort()
Returns
Type |
Description |
System.UInt16 |
|
SetSource(NetDataWriter)
Declaration
public void SetSource(NetDataWriter dataWriter)
Parameters
SetSource(Byte[])
Declaration
public void SetSource(byte[] source)
Parameters
Type |
Name |
Description |
System.Byte[] |
source |
|
SetSource(Byte[], Int32)
Declaration
public void SetSource(byte[] source, int offset)
Parameters
Type |
Name |
Description |
System.Byte[] |
source |
|
System.Int32 |
offset |
|
SetSource(Byte[], Int32, Int32)
Declaration
public void SetSource(byte[] source, int offset, int maxSize)
Parameters
Type |
Name |
Description |
System.Byte[] |
source |
|
System.Int32 |
offset |
|
System.Int32 |
maxSize |
|
SkipBytes(Int32)
Declaration
public void SkipBytes(int count)
Parameters
Type |
Name |
Description |
System.Int32 |
count |
|
TryGetBool(out Boolean)
Declaration
public bool TryGetBool(out bool result)
Parameters
Type |
Name |
Description |
System.Boolean |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetByte(out Byte)
Declaration
public bool TryGetByte(out byte result)
Parameters
Type |
Name |
Description |
System.Byte |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetBytesWithLength(out Byte[])
Declaration
public bool TryGetBytesWithLength(out byte[] result)
Parameters
Type |
Name |
Description |
System.Byte[] |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetChar(out Char)
Declaration
public bool TryGetChar(out char result)
Parameters
Type |
Name |
Description |
System.Char |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetDouble(out Double)
Declaration
public bool TryGetDouble(out double result)
Parameters
Type |
Name |
Description |
System.Double |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetFloat(out Single)
Declaration
public bool TryGetFloat(out float result)
Parameters
Type |
Name |
Description |
System.Single |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetInt(out Int32)
Declaration
public bool TryGetInt(out int result)
Parameters
Type |
Name |
Description |
System.Int32 |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetLong(out Int64)
Declaration
public bool TryGetLong(out long result)
Parameters
Type |
Name |
Description |
System.Int64 |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetSByte(out SByte)
Declaration
public bool TryGetSByte(out sbyte result)
Parameters
Type |
Name |
Description |
System.SByte |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetShort(out Int16)
Declaration
public bool TryGetShort(out short result)
Parameters
Type |
Name |
Description |
System.Int16 |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetString(out String)
Declaration
public bool TryGetString(out string result)
Parameters
Type |
Name |
Description |
System.String |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetStringArray(out String[])
Declaration
public bool TryGetStringArray(out string[] result)
Parameters
Type |
Name |
Description |
System.String[] |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetUInt(out UInt32)
Declaration
public bool TryGetUInt(out uint result)
Parameters
Type |
Name |
Description |
System.UInt32 |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetULong(out UInt64)
Declaration
public bool TryGetULong(out ulong result)
Parameters
Type |
Name |
Description |
System.UInt64 |
result |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetUShort(out UInt16)
Declaration
public bool TryGetUShort(out ushort result)
Parameters
Type |
Name |
Description |
System.UInt16 |
result |
|
Returns
Type |
Description |
System.Boolean |
|