Struct SpanReader
- Namespace
- LiteEntitySystem
- Assembly
- LiteEntitySystem.dll
public ref struct SpanReader
Constructors
SpanReader(ReadOnlySpan<byte>)
public SpanReader(ReadOnlySpan<byte> rawData)
Parameters
rawDataReadOnlySpan<byte>
Fields
Position
public int Position
Field Value
RawData
public readonly ReadOnlySpan<byte> RawData
Field Value
Properties
AvailableBytes
public int AvailableBytes { get; }
Property Value
Methods
Get(out bool)
public void Get(out bool result)
Parameters
resultbool
Get(out byte)
public void Get(out byte result)
Parameters
resultbyte
Get(out char)
public void Get(out char result)
Parameters
resultchar
Get(out double)
public void Get(out double result)
Parameters
resultdouble
Get(out Guid)
public void Get(out Guid result)
Parameters
resultGuid
Get(out short)
public void Get(out short result)
Parameters
resultshort
Get(out int)
public void Get(out int result)
Parameters
resultint
Get(out long)
public void Get(out long result)
Parameters
resultlong
Get(out sbyte)
public void Get(out sbyte result)
Parameters
resultsbyte
Get(out float)
public void Get(out float result)
Parameters
resultfloat
Get(out string)
public void Get(out string result)
Parameters
resultstring
Get(out string, int)
public void Get(out string result, int maxLength)
Parameters
Get(out ushort)
public void Get(out ushort result)
Parameters
resultushort
Get(out uint)
public void Get(out uint result)
Parameters
resultuint
Get(out ulong)
public void Get(out ulong result)
Parameters
resultulong
GetArray<T>()
public T[] GetArray<T>() where T : ISpanSerializable, new()
Returns
- T[]
Type Parameters
T
GetArray<T>(Func<T>)
public T[] GetArray<T>(Func<T> constructor) where T : class, ISpanSerializable
Parameters
constructorFunc<T>
Returns
- T[]
Type Parameters
T
GetArray<T>(ushort)
public T[] GetArray<T>(ushort size) where T : unmanaged
Parameters
sizeushort
Returns
- T[]
Type Parameters
T
GetBool()
public bool GetBool()
Returns
GetBoolArray()
public bool[] GetBoolArray()
Returns
- bool[]
GetByte()
public byte GetByte()
Returns
GetBytes(byte[], int)
public void GetBytes(byte[] destination, int count)
Parameters
GetBytes(byte[], int, int)
public void GetBytes(byte[] destination, int start, int count)
Parameters
GetBytesWithLength()
public byte[] GetBytesWithLength()
Returns
- byte[]
GetChar()
public char GetChar()
Returns
GetDouble()
public double GetDouble()
Returns
GetDoubleArray()
public double[] GetDoubleArray()
Returns
- double[]
GetFloat()
public float GetFloat()
Returns
GetFloatArray()
public float[] GetFloatArray()
Returns
- float[]
GetGuid()
public Guid GetGuid()
Returns
GetInt()
public int GetInt()
Returns
GetIntArray()
public int[] GetIntArray()
Returns
- int[]
GetLargeString()
public string GetLargeString()
Returns
GetLong()
public long GetLong()
Returns
GetLongArray()
public long[] GetLongArray()
Returns
- long[]
GetRemainingBytes()
public byte[] GetRemainingBytes()
Returns
- byte[]
GetRemainingBytesSpan()
public ReadOnlySpan<byte> GetRemainingBytesSpan()
Returns
GetSByte()
public sbyte GetSByte()
Returns
GetSBytesWithLength()
public sbyte[] GetSBytesWithLength()
Returns
- sbyte[]
GetShort()
public short GetShort()
Returns
GetShortArray()
public short[] GetShortArray()
Returns
- short[]
GetString()
public string GetString()
Returns
GetString(int)
Note that "maxLength" only limits the number of characters in a string, not its size in bytes.
public string GetString(int maxLength)
Parameters
maxLengthint
Returns
- string
"string.Empty" if value > "maxLength"
GetStringArray()
public string[] GetStringArray()
Returns
- string[]
GetStringArray(int)
Note that "maxStringLength" only limits the number of characters in a string, not its size in bytes. Strings that exceed this parameter are returned as empty
public string[] GetStringArray(int maxStringLength)
Parameters
maxStringLengthint
Returns
- string[]
GetStruct<T>()
public T GetStruct<T>() where T : unmanaged
Returns
- T
Type Parameters
T
GetStruct<T>(out T)
public void GetStruct<T>(out T result) where T : unmanaged
Parameters
resultT
Type Parameters
T
GetUInt()
public uint GetUInt()
Returns
GetUIntArray()
public uint[] GetUIntArray()
Returns
- uint[]
GetULong()
public ulong GetULong()
Returns
GetULongArray()
public ulong[] GetULongArray()
Returns
- ulong[]
GetUShort()
public ushort GetUShort()
Returns
GetUShortArray()
public ushort[] GetUShortArray()
Returns
- ushort[]
Get<T>()
public T Get<T>() where T : struct, ISpanSerializable
Returns
- T
Type Parameters
T
Get<T>(Func<T>)
public T Get<T>(Func<T> constructor) where T : class, ISpanSerializable
Parameters
constructorFunc<T>
Returns
- T
Type Parameters
T
Get<T>(out T)
public void Get<T>(out T result) where T : struct, ISpanSerializable
Parameters
resultT
Type Parameters
T
Get<T>(out T, Func<T>)
public void Get<T>(out T result, Func<T> constructor) where T : class, ISpanSerializable
Parameters
resultTconstructorFunc<T>
Type Parameters
T
PeekBool()
public bool PeekBool()
Returns
PeekByte()
public byte PeekByte()
Returns
PeekChar()
public char PeekChar()
Returns
PeekDouble()
public double PeekDouble()
Returns
PeekFloat()
public float PeekFloat()
Returns
PeekInt()
public int PeekInt()
Returns
PeekLong()
public long PeekLong()
Returns
PeekSByte()
public sbyte PeekSByte()
Returns
PeekShort()
public short PeekShort()
Returns
PeekString()
public string PeekString()
Returns
PeekString(int)
Note that "maxLength" only limits the number of characters in a string, not its size in bytes.
public string PeekString(int maxLength)
Parameters
maxLengthint
Returns
PeekUInt()
public uint PeekUInt()
Returns
PeekULong()
public ulong PeekULong()
Returns
PeekUShort()
public ushort PeekUShort()
Returns
TryGetBool(out bool)
public bool TryGetBool(out bool result)
Parameters
resultbool
Returns
TryGetByte(out byte)
public bool TryGetByte(out byte result)
Parameters
resultbyte
Returns
TryGetBytesWithLength(out byte[])
public bool TryGetBytesWithLength(out byte[] result)
Parameters
resultbyte[]
Returns
TryGetChar(out char)
public bool TryGetChar(out char result)
Parameters
resultchar
Returns
TryGetDouble(out double)
public bool TryGetDouble(out double result)
Parameters
resultdouble
Returns
TryGetFloat(out float)
public bool TryGetFloat(out float result)
Parameters
resultfloat
Returns
TryGetInt(out int)
public bool TryGetInt(out int result)
Parameters
resultint
Returns
TryGetLong(out long)
public bool TryGetLong(out long result)
Parameters
resultlong
Returns
TryGetSByte(out sbyte)
public bool TryGetSByte(out sbyte result)
Parameters
resultsbyte
Returns
TryGetShort(out short)
public bool TryGetShort(out short result)
Parameters
resultshort
Returns
TryGetString(out string)
public bool TryGetString(out string result)
Parameters
resultstring
Returns
TryGetStringArray(out string[])
public bool TryGetStringArray(out string[] result)
Parameters
resultstring[]
Returns
TryGetUInt(out uint)
public bool TryGetUInt(out uint result)
Parameters
resultuint
Returns
TryGetULong(out ulong)
public bool TryGetULong(out ulong result)
Parameters
resultulong
Returns
TryGetUShort(out ushort)
public bool TryGetUShort(out ushort result)
Parameters
resultushort