Show / Hide Table of Contents

# Struct SpanReader

###### Namespace: LiteEntitySystem

###### Assembly: LiteEntitySystem.dll

##### Syntax

    public ref struct SpanReader

### Constructors

#### SpanReader(ReadOnlySpan<byte>)

##### Declaration

    public SpanReader(ReadOnlySpan<byte> rawData)

##### Parameters

Type | Name | Description
--- | --- | ---
ReadOnlySpan<byte> | rawData |

### Fields

#### Position

##### Declaration

    public int Position

##### Field Value

Type | Description
--- | ---
int |

#### RawData

##### Declaration

    public readonly ReadOnlySpan<byte> RawData

##### Field Value

Type | Description
--- | ---
ReadOnlySpan<byte> |

### Properties

#### AvailableBytes

##### Declaration

    public int AvailableBytes { get; }

##### Property Value

Type | Description
--- | ---
int |

### 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 | Description
--- | ---
T[] |

##### Type Parameters

Name | Description
--- | ---
T |

#### 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 | Description
--- | ---
T[] |

##### Type Parameters

Name | Description
--- | ---
T |

#### GetArray<T>(ushort)

##### Declaration

    public T[] GetArray<T>(ushort size) where T : unmanaged

##### Parameters

Type | Name | Description
--- | --- | ---
ushort | size |

##### Returns

Type | Description
--- | ---
T[] |

##### Type Parameters

Name | Description
--- | ---
T |

#### GetBool()

##### Declaration

    public bool GetBool()

##### Returns

Type | Description
--- | ---
bool |

#### GetBoolArray()

##### Declaration

    public bool[] GetBoolArray()

##### Returns

Type | Description
--- | ---
bool[] |

#### GetByte()

##### Declaration

    public byte GetByte()

##### Returns

Type | Description
--- | ---
byte |

#### 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

Type | Description
--- | ---
byte[] |

#### GetChar()

##### Declaration

    public char GetChar()

##### Returns

Type | Description
--- | ---
char |

#### GetDouble()

##### Declaration

    public double GetDouble()

##### Returns

Type | Description
--- | ---
double |

#### GetDoubleArray()

##### Declaration

    public double[] GetDoubleArray()

##### Returns

Type | Description
--- | ---
double[] |

#### GetFloat()

##### Declaration

    public float GetFloat()

##### Returns

Type | Description
--- | ---
float |

#### GetFloatArray()

##### Declaration

    public float[] GetFloatArray()

##### Returns

Type | Description
--- | ---
float[] |

#### GetGuid()

##### Declaration

    public Guid GetGuid()

##### Returns

Type | Description
--- | ---
Guid |

#### GetInt()

##### Declaration

    public int GetInt()

##### Returns

Type | Description
--- | ---
int |

#### GetIntArray()

##### Declaration

    public int[] GetIntArray()

##### Returns

Type | Description
--- | ---
int[] |

#### GetLargeString()

##### Declaration

    public string GetLargeString()

##### Returns

Type | Description
--- | ---
string |

#### GetLong()

##### Declaration

    public long GetLong()

##### Returns

Type | Description
--- | ---
long |

#### GetLongArray()

##### Declaration

    public long[] GetLongArray()

##### Returns

Type | Description
--- | ---
long[] |

#### GetRemainingBytes()

##### Declaration

    public byte[] GetRemainingBytes()

##### Returns

Type | Description
--- | ---
byte[] |

#### GetRemainingBytesSpan()

##### Declaration

    public ReadOnlySpan<byte> GetRemainingBytesSpan()

##### Returns

Type | Description
--- | ---
ReadOnlySpan<byte> |

#### GetSByte()

##### Declaration

    public sbyte GetSByte()

##### Returns

Type | Description
--- | ---
sbyte |

#### GetSBytesWithLength()

##### Declaration

    public sbyte[] GetSBytesWithLength()

##### Returns

Type | Description
--- | ---
sbyte[] |

#### GetShort()

##### Declaration

    public short GetShort()

##### Returns

Type | Description
--- | ---
short |

#### GetShortArray()

##### Declaration

    public short[] GetShortArray()

##### Returns

Type | Description
--- | ---
short[] |

#### GetString()

##### Declaration

    public string GetString()

##### Returns

Type | Description
--- | ---
string |

#### 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

Type | Description
--- | ---
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

##### Declaration

    public string[] GetStringArray(int maxStringLength)

##### Parameters

Type | Name | Description
--- | --- | ---
int | maxStringLength |

##### Returns

Type | Description
--- | ---
string[] |

#### GetUInt()

##### Declaration

    public uint GetUInt()

##### Returns

Type | Description
--- | ---
uint |

#### GetUIntArray()

##### Declaration

    public uint[] GetUIntArray()

##### Returns

Type | Description
--- | ---
uint[] |

#### GetULong()

##### Declaration

    public ulong GetULong()

##### Returns

Type | Description
--- | ---
ulong |

#### GetULongArray()

##### Declaration

    public ulong[] GetULongArray()

##### Returns

Type | Description
--- | ---
ulong[] |

#### GetUShort()

##### Declaration

    public ushort GetUShort()

##### Returns

Type | Description
--- | ---
ushort |

#### GetUShortArray()

##### Declaration

    public ushort[] GetUShortArray()

##### Returns

Type | Description
--- | ---
ushort[] |

#### Get<T>()

##### Declaration

    public T Get<T>() where T : struct, ISpanSerializable

##### Returns

Type | Description
--- | ---
T |

##### Type Parameters

Name | Description
--- | ---
T |

#### 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 | Description
--- | ---
T |

##### Type Parameters

Name | Description
--- | ---
T |

#### Get<T>(out T)

##### Declaration

    public void Get<T>(out T result) where T : struct, ISpanSerializable

##### Parameters

Type | Name | Description
--- | --- | ---
T | result |

##### Type Parameters

Name | Description
--- | ---
T |

#### 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

Name | Description
--- | ---
T |

#### PeekBool()

##### Declaration

    public bool PeekBool()

##### Returns

Type | Description
--- | ---
bool |

#### PeekByte()

##### Declaration

    public byte PeekByte()

##### Returns

Type | Description
--- | ---
byte |

#### PeekChar()

##### Declaration

    public char PeekChar()

##### Returns

Type | Description
--- | ---
char |

#### PeekDouble()

##### Declaration

    public double PeekDouble()

##### Returns

Type | Description
--- | ---
double |

#### PeekFloat()

##### Declaration

    public float PeekFloat()

##### Returns

Type | Description
--- | ---
float |

#### PeekInt()

##### Declaration

    public int PeekInt()

##### Returns

Type | Description
--- | ---
int |

#### PeekLong()

##### Declaration

    public long PeekLong()

##### Returns

Type | Description
--- | ---
long |

#### PeekSByte()

##### Declaration

    public sbyte PeekSByte()

##### Returns

Type | Description
--- | ---
sbyte |

#### PeekShort()

##### Declaration

    public short PeekShort()

##### Returns

Type | Description
--- | ---
short |

#### PeekString()

##### Declaration

    public string PeekString()

##### Returns

Type | Description
--- | ---
string |

#### 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

Type | Description
--- | ---
string |

#### PeekUInt()

##### Declaration

    public uint PeekUInt()

##### Returns

Type | Description
--- | ---
uint |

#### PeekULong()

##### Declaration

    public ulong PeekULong()

##### Returns

Type | Description
--- | ---
ulong |

#### PeekUShort()

##### Declaration

    public ushort PeekUShort()

##### Returns

Type | Description
--- | ---
ushort |

#### TryGetBool(out bool)

##### Declaration

    public bool TryGetBool(out bool result)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetByte(out byte)

##### Declaration

    public bool TryGetByte(out byte result)

##### Parameters

Type | Name | Description
--- | --- | ---
byte | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetBytesWithLength(out byte[])

##### Declaration

    public bool TryGetBytesWithLength(out byte[] result)

##### Parameters

Type | Name | Description
--- | --- | ---
byte[] | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetChar(out char)

##### Declaration

    public bool TryGetChar(out char result)

##### Parameters

Type | Name | Description
--- | --- | ---
char | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetDouble(out double)

##### Declaration

    public bool TryGetDouble(out double result)

##### Parameters

Type | Name | Description
--- | --- | ---
double | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetFloat(out float)

##### Declaration

    public bool TryGetFloat(out float result)

##### Parameters

Type | Name | Description
--- | --- | ---
float | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetInt(out int)

##### Declaration

    public bool TryGetInt(out int result)

##### Parameters

Type | Name | Description
--- | --- | ---
int | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetLong(out long)

##### Declaration

    public bool TryGetLong(out long result)

##### Parameters

Type | Name | Description
--- | --- | ---
long | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetSByte(out sbyte)

##### Declaration

    public bool TryGetSByte(out sbyte result)

##### Parameters

Type | Name | Description
--- | --- | ---
sbyte | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetShort(out short)

##### Declaration

    public bool TryGetShort(out short result)

##### Parameters

Type | Name | Description
--- | --- | ---
short | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetString(out string)

##### Declaration

    public bool TryGetString(out string result)

##### Parameters

Type | Name | Description
--- | --- | ---
string | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetStringArray(out string[])

##### Declaration

    public bool TryGetStringArray(out string[] result)

##### Parameters

Type | Name | Description
--- | --- | ---
string[] | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetUInt(out uint)

##### Declaration

    public bool TryGetUInt(out uint result)

##### Parameters

Type | Name | Description
--- | --- | ---
uint | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetULong(out ulong)

##### Declaration

    public bool TryGetULong(out ulong result)

##### Parameters

Type | Name | Description
--- | --- | ---
ulong | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetUShort(out ushort)

##### Declaration

    public bool TryGetUShort(out ushort result)

##### Parameters

Type | Name | Description
--- | --- | ---
ushort | result |

##### Returns

Type | Description
--- | ---
bool |