Table of Contents

Struct SpanReader

Namespace
LiteEntitySystem
Assembly
LiteEntitySystem.dll
public ref struct SpanReader

Constructors

SpanReader(ReadOnlySpan<byte>)

public SpanReader(ReadOnlySpan<byte> rawData)

Parameters

rawData ReadOnlySpan<byte>

Fields

Position

public int Position

Field Value

int

RawData

public readonly ReadOnlySpan<byte> RawData

Field Value

ReadOnlySpan<byte>

Properties

AvailableBytes

public int AvailableBytes { get; }

Property Value

int

Methods

Get(out bool)

public void Get(out bool result)

Parameters

result bool

Get(out byte)

public void Get(out byte result)

Parameters

result byte

Get(out char)

public void Get(out char result)

Parameters

result char

Get(out double)

public void Get(out double result)

Parameters

result double

Get(out Guid)

public void Get(out Guid result)

Parameters

result Guid

Get(out short)

public void Get(out short result)

Parameters

result short

Get(out int)

public void Get(out int result)

Parameters

result int

Get(out long)

public void Get(out long result)

Parameters

result long

Get(out sbyte)

public void Get(out sbyte result)

Parameters

result sbyte

Get(out float)

public void Get(out float result)

Parameters

result float

Get(out string)

public void Get(out string result)

Parameters

result string

Get(out string, int)

public void Get(out string result, int maxLength)

Parameters

result string
maxLength int

Get(out ushort)

public void Get(out ushort result)

Parameters

result ushort

Get(out uint)

public void Get(out uint result)

Parameters

result uint

Get(out ulong)

public void Get(out ulong result)

Parameters

result ulong

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

constructor Func<T>

Returns

T[]

Type Parameters

T

GetArray<T>(ushort)

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

Parameters

size ushort

Returns

T[]

Type Parameters

T

GetBool()

public bool GetBool()

Returns

bool

GetBoolArray()

public bool[] GetBoolArray()

Returns

bool[]

GetByte()

public byte GetByte()

Returns

byte

GetBytes(byte[], int)

public void GetBytes(byte[] destination, int count)

Parameters

destination byte[]
count int

GetBytes(byte[], int, int)

public void GetBytes(byte[] destination, int start, int count)

Parameters

destination byte[]
start int
count int

GetBytesWithLength()

public byte[] GetBytesWithLength()

Returns

byte[]

GetChar()

public char GetChar()

Returns

char

GetDouble()

public double GetDouble()

Returns

double

GetDoubleArray()

public double[] GetDoubleArray()

Returns

double[]

GetFloat()

public float GetFloat()

Returns

float

GetFloatArray()

public float[] GetFloatArray()

Returns

float[]

GetGuid()

public Guid GetGuid()

Returns

Guid

GetInt()

public int GetInt()

Returns

int

GetIntArray()

public int[] GetIntArray()

Returns

int[]

GetLargeString()

public string GetLargeString()

Returns

string

GetLong()

public long GetLong()

Returns

long

GetLongArray()

public long[] GetLongArray()

Returns

long[]

GetRemainingBytes()

public byte[] GetRemainingBytes()

Returns

byte[]

GetRemainingBytesSpan()

public ReadOnlySpan<byte> GetRemainingBytesSpan()

Returns

ReadOnlySpan<byte>

GetSByte()

public sbyte GetSByte()

Returns

sbyte

GetSBytesWithLength()

public sbyte[] GetSBytesWithLength()

Returns

sbyte[]

GetShort()

public short GetShort()

Returns

short

GetShortArray()

public short[] GetShortArray()

Returns

short[]

GetString()

public string GetString()

Returns

string

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

maxLength int

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

maxStringLength int

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

result T

Type Parameters

T

GetUInt()

public uint GetUInt()

Returns

uint

GetUIntArray()

public uint[] GetUIntArray()

Returns

uint[]

GetULong()

public ulong GetULong()

Returns

ulong

GetULongArray()

public ulong[] GetULongArray()

Returns

ulong[]

GetUShort()

public ushort GetUShort()

Returns

ushort

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

constructor Func<T>

Returns

T

Type Parameters

T

Get<T>(out T)

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

Parameters

result T

Type Parameters

T

Get<T>(out T, Func<T>)

public void Get<T>(out T result, Func<T> constructor) where T : class, ISpanSerializable

Parameters

result T
constructor Func<T>

Type Parameters

T

PeekBool()

public bool PeekBool()

Returns

bool

PeekByte()

public byte PeekByte()

Returns

byte

PeekChar()

public char PeekChar()

Returns

char

PeekDouble()

public double PeekDouble()

Returns

double

PeekFloat()

public float PeekFloat()

Returns

float

PeekInt()

public int PeekInt()

Returns

int

PeekLong()

public long PeekLong()

Returns

long

PeekSByte()

public sbyte PeekSByte()

Returns

sbyte

PeekShort()

public short PeekShort()

Returns

short

PeekString()

public string PeekString()

Returns

string

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

maxLength int

Returns

string

PeekUInt()

public uint PeekUInt()

Returns

uint

PeekULong()

public ulong PeekULong()

Returns

ulong

PeekUShort()

public ushort PeekUShort()

Returns

ushort

TryGetBool(out bool)

public bool TryGetBool(out bool result)

Parameters

result bool

Returns

bool

TryGetByte(out byte)

public bool TryGetByte(out byte result)

Parameters

result byte

Returns

bool

TryGetBytesWithLength(out byte[])

public bool TryGetBytesWithLength(out byte[] result)

Parameters

result byte[]

Returns

bool

TryGetChar(out char)

public bool TryGetChar(out char result)

Parameters

result char

Returns

bool

TryGetDouble(out double)

public bool TryGetDouble(out double result)

Parameters

result double

Returns

bool

TryGetFloat(out float)

public bool TryGetFloat(out float result)

Parameters

result float

Returns

bool

TryGetInt(out int)

public bool TryGetInt(out int result)

Parameters

result int

Returns

bool

TryGetLong(out long)

public bool TryGetLong(out long result)

Parameters

result long

Returns

bool

TryGetSByte(out sbyte)

public bool TryGetSByte(out sbyte result)

Parameters

result sbyte

Returns

bool

TryGetShort(out short)

public bool TryGetShort(out short result)

Parameters

result short

Returns

bool

TryGetString(out string)

public bool TryGetString(out string result)

Parameters

result string

Returns

bool

TryGetStringArray(out string[])

public bool TryGetStringArray(out string[] result)

Parameters

result string[]

Returns

bool

TryGetUInt(out uint)

public bool TryGetUInt(out uint result)

Parameters

result uint

Returns

bool

TryGetULong(out ulong)

public bool TryGetULong(out ulong result)

Parameters

result ulong

Returns

bool

TryGetUShort(out ushort)

public bool TryGetUShort(out ushort result)

Parameters

result ushort

Returns

bool