Struct SpanReader
Assembly: LiteEntitySystem.dll
Syntax
public ref struct SpanReader
Constructors
SpanReader(ReadOnlySpan<byte>)
Declaration
public SpanReader(ReadOnlySpan<byte> rawData)
Parameters
Fields
Position
Declaration
Field Value
RawData
Declaration
public readonly ReadOnlySpan<byte> RawData
Field Value
Properties
AvailableBytes
Declaration
public int AvailableBytes { get; }
Property Value
Methods
Get(out bool)
Declaration
public void Get(out bool result)
Parameters
Type |
Name |
Description |
bool |
result |
|
Get(out byte)
Declaration
public void Get(out byte result)
Parameters
Type |
Name |
Description |
byte |
result |
|
Get(out char)
Declaration
public void Get(out char result)
Parameters
Type |
Name |
Description |
char |
result |
|
Get(out double)
Declaration
public void Get(out double result)
Parameters
Type |
Name |
Description |
double |
result |
|
Get(out Guid)
Declaration
public void Get(out Guid result)
Parameters
Type |
Name |
Description |
Guid |
result |
|
Get(out short)
Declaration
public void Get(out short result)
Parameters
Type |
Name |
Description |
short |
result |
|
Get(out int)
Declaration
public void Get(out int result)
Parameters
Type |
Name |
Description |
int |
result |
|
Get(out long)
Declaration
public void Get(out long result)
Parameters
Type |
Name |
Description |
long |
result |
|
Get(out sbyte)
Declaration
public void Get(out sbyte result)
Parameters
Type |
Name |
Description |
sbyte |
result |
|
Get(out float)
Declaration
public void Get(out float result)
Parameters
Type |
Name |
Description |
float |
result |
|
Get(out string)
Declaration
public void Get(out string result)
Parameters
Type |
Name |
Description |
string |
result |
|
Get(out string, int)
Declaration
public void Get(out string result, int maxLength)
Parameters
Type |
Name |
Description |
string |
result |
|
int |
maxLength |
|
Get(out ushort)
Declaration
public void Get(out ushort result)
Parameters
Type |
Name |
Description |
ushort |
result |
|
Get(out uint)
Declaration
public void Get(out uint result)
Parameters
Type |
Name |
Description |
uint |
result |
|
Get(out ulong)
Declaration
public void Get(out ulong result)
Parameters
Type |
Name |
Description |
ulong |
result |
|
GetArray<T>()
Declaration
public T[] GetArray<T>() where T : ISpanSerializable, new()
Returns
Type Parameters
GetArray<T>(Func<T>)
Declaration
public T[] GetArray<T>(Func<T> constructor) where T : class, ISpanSerializable
Parameters
Type |
Name |
Description |
Func<T> |
constructor |
|
Returns
Type Parameters
GetArray<T>(ushort)
Declaration
public T[] GetArray<T>(ushort size) where T : unmanaged
Parameters
Type |
Name |
Description |
ushort |
size |
|
Returns
Type Parameters
GetBool()
Declaration
Returns
GetBoolArray()
Declaration
public bool[] GetBoolArray()
Returns
GetByte()
Declaration
Returns
GetBytes(byte[], int)
Declaration
public void GetBytes(byte[] destination, int count)
Parameters
Type |
Name |
Description |
byte[] |
destination |
|
int |
count |
|
GetBytes(byte[], int, int)
Declaration
public void GetBytes(byte[] destination, int start, int count)
Parameters
Type |
Name |
Description |
byte[] |
destination |
|
int |
start |
|
int |
count |
|
GetBytesWithLength()
Declaration
public byte[] GetBytesWithLength()
Returns
GetChar()
Declaration
Returns
GetDouble()
Declaration
public double GetDouble()
Returns
GetDoubleArray()
Declaration
public double[] GetDoubleArray()
Returns
GetFloat()
Declaration
Returns
GetFloatArray()
Declaration
public float[] GetFloatArray()
Returns
GetGuid()
Declaration
Returns
GetInt()
Declaration
Returns
GetIntArray()
Declaration
public int[] GetIntArray()
Returns
GetLargeString()
Declaration
public string GetLargeString()
Returns
GetLong()
Declaration
Returns
GetLongArray()
Declaration
public long[] GetLongArray()
Returns
GetRemainingBytes()
Declaration
public byte[] GetRemainingBytes()
Returns
GetRemainingBytesSpan()
Declaration
public ReadOnlySpan<byte> GetRemainingBytesSpan()
Returns
GetSByte()
Declaration
Returns
GetSBytesWithLength()
Declaration
public sbyte[] GetSBytesWithLength()
Returns
GetShort()
Declaration
Returns
GetShortArray()
Declaration
public short[] GetShortArray()
Returns
GetString()
Declaration
public string GetString()
Returns
GetString(int)
Note that "maxLength" only limits the number of characters in a string, not its size in bytes.
Declaration
public string GetString(int maxLength)
Parameters
Type |
Name |
Description |
int |
maxLength |
|
Returns
Type |
Description |
string |
"string.Empty" if value > "maxLength"
|
GetStringArray()
Declaration
public string[] GetStringArray()
Returns
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
Declaration
public string[] GetStringArray(int maxStringLength)
Parameters
Type |
Name |
Description |
int |
maxStringLength |
|
Returns
GetUInt()
Declaration
Returns
GetUIntArray()
Declaration
public uint[] GetUIntArray()
Returns
GetULong()
Declaration
Returns
GetULongArray()
Declaration
public ulong[] GetULongArray()
Returns
GetUShort()
Declaration
public ushort GetUShort()
Returns
GetUShortArray()
Declaration
public ushort[] GetUShortArray()
Returns
Get<T>()
Declaration
public T Get<T>() where T : struct, ISpanSerializable
Returns
Type Parameters
Get<T>(Func<T>)
Declaration
public T Get<T>(Func<T> constructor) where T : class, ISpanSerializable
Parameters
Type |
Name |
Description |
Func<T> |
constructor |
|
Returns
Type Parameters
Get<T>(out T)
Declaration
public void Get<T>(out T result) where T : struct, ISpanSerializable
Parameters
Type |
Name |
Description |
T |
result |
|
Type Parameters
Get<T>(out T, Func<T>)
Declaration
public void Get<T>(out T result, Func<T> constructor) where T : class, ISpanSerializable
Parameters
Type |
Name |
Description |
T |
result |
|
Func<T> |
constructor |
|
Type Parameters
PeekBool()
Declaration
Returns
PeekByte()
Declaration
Returns
PeekChar()
Declaration
Returns
PeekDouble()
Declaration
public double PeekDouble()
Returns
PeekFloat()
Declaration
Returns
PeekInt()
Declaration
Returns
PeekLong()
Declaration
Returns
PeekSByte()
Declaration
Returns
PeekShort()
Declaration
Returns
PeekString()
Declaration
public string PeekString()
Returns
PeekString(int)
Note that "maxLength" only limits the number of characters in a string, not its size in bytes.
Declaration
public string PeekString(int maxLength)
Parameters
Type |
Name |
Description |
int |
maxLength |
|
Returns
PeekUInt()
Declaration
Returns
PeekULong()
Declaration
Returns
PeekUShort()
Declaration
public ushort PeekUShort()
Returns
TryGetBool(out bool)
Declaration
public bool TryGetBool(out bool result)
Parameters
Type |
Name |
Description |
bool |
result |
|
Returns
TryGetByte(out byte)
Declaration
public bool TryGetByte(out byte result)
Parameters
Type |
Name |
Description |
byte |
result |
|
Returns
TryGetBytesWithLength(out byte[])
Declaration
public bool TryGetBytesWithLength(out byte[] result)
Parameters
Type |
Name |
Description |
byte[] |
result |
|
Returns
TryGetChar(out char)
Declaration
public bool TryGetChar(out char result)
Parameters
Type |
Name |
Description |
char |
result |
|
Returns
TryGetDouble(out double)
Declaration
public bool TryGetDouble(out double result)
Parameters
Type |
Name |
Description |
double |
result |
|
Returns
TryGetFloat(out float)
Declaration
public bool TryGetFloat(out float result)
Parameters
Type |
Name |
Description |
float |
result |
|
Returns
TryGetInt(out int)
Declaration
public bool TryGetInt(out int result)
Parameters
Type |
Name |
Description |
int |
result |
|
Returns
TryGetLong(out long)
Declaration
public bool TryGetLong(out long result)
Parameters
Type |
Name |
Description |
long |
result |
|
Returns
TryGetSByte(out sbyte)
Declaration
public bool TryGetSByte(out sbyte result)
Parameters
Type |
Name |
Description |
sbyte |
result |
|
Returns
TryGetShort(out short)
Declaration
public bool TryGetShort(out short result)
Parameters
Type |
Name |
Description |
short |
result |
|
Returns
TryGetString(out string)
Declaration
public bool TryGetString(out string result)
Parameters
Type |
Name |
Description |
string |
result |
|
Returns
TryGetStringArray(out string[])
Declaration
public bool TryGetStringArray(out string[] result)
Parameters
Type |
Name |
Description |
string[] |
result |
|
Returns
TryGetUInt(out uint)
Declaration
public bool TryGetUInt(out uint result)
Parameters
Type |
Name |
Description |
uint |
result |
|
Returns
TryGetULong(out ulong)
Declaration
public bool TryGetULong(out ulong result)
Parameters
Type |
Name |
Description |
ulong |
result |
|
Returns
TryGetUShort(out ushort)
Declaration
public bool TryGetUShort(out ushort result)
Parameters
Type |
Name |
Description |
ushort |
result |
|
Returns