Show / Hide Table of Contents

# Struct SpanWriter

###### Namespace: LiteEntitySystem

###### Assembly: LiteEntitySystem.dll

##### Syntax

    public ref struct SpanWriter

### Constructors

#### SpanWriter(Span<byte>)

##### Declaration

    public SpanWriter(Span<byte> rawData)

##### Parameters

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

### Fields

#### Position

##### Declaration

    public int Position

##### Field Value

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

#### RawData

##### Declaration

    public readonly Span<byte> RawData

##### Field Value

Type | Description
--- | ---
Span<byte> |

### Methods

#### GetMaxLargeStringSize(string)

Return maximum large string size

##### Declaration

    public static int GetMaxLargeStringSize(string str)

##### Parameters

Type | Name | Description
--- | --- | ---
string | str |

##### Returns

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

#### GetMaxStringSize(string)

Return maximum short string size (up to 65535 bytes)

##### Declaration

    public static int GetMaxStringSize(string str)

##### Parameters

Type | Name | Description
--- | --- | ---
string | str |

##### Returns

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

#### Put(bool)

##### Declaration

    public void Put(bool value)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | value |

#### Put(byte)

##### Declaration

    public void Put(byte value)

##### Parameters

Type | Name | Description
--- | --- | ---
byte | value |

#### Put(byte[])

##### Declaration

    public void Put(byte[] data)

##### Parameters

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

#### Put(byte[], int, int)

##### Declaration

    public void Put(byte[] data, int offset, int length)

##### Parameters

Type | Name | Description
--- | --- | ---
byte[] | data |
int | offset |
int | length |

#### Put(char)

##### Declaration

    public void Put(char value)

##### Parameters

Type | Name | Description
--- | --- | ---
char | value |

#### Put(double)

##### Declaration

    public void Put(double value)

##### Parameters

Type | Name | Description
--- | --- | ---
double | value |

#### Put(Guid)

##### Declaration

    public void Put(Guid value)

##### Parameters

Type | Name | Description
--- | --- | ---
Guid | value |

#### Put(short)

##### Declaration

    public void Put(short value)

##### Parameters

Type | Name | Description
--- | --- | ---
short | value |

#### Put(int)

##### Declaration

    public void Put(int value)

##### Parameters

Type | Name | Description
--- | --- | ---
int | value |

#### Put(long)

##### Declaration

    public void Put(long value)

##### Parameters

Type | Name | Description
--- | --- | ---
long | value |

#### Put(sbyte)

##### Declaration

    public void Put(sbyte value)

##### Parameters

Type | Name | Description
--- | --- | ---
sbyte | value |

#### Put(float)

##### Declaration

    public void Put(float value)

##### Parameters

Type | Name | Description
--- | --- | ---
float | value |

#### Put(string)

##### Declaration

    public void Put(string value)

##### Parameters

Type | Name | Description
--- | --- | ---
string | value |

#### Put(string, int)

Note that "maxLength" only limits the number of characters in a string, not its size in bytes.

##### Declaration

    public void Put(string value, int maxLength)

##### Parameters

Type | Name | Description
--- | --- | ---
string | value |
int | maxLength |

#### Put(ushort)

##### Declaration

    public void Put(ushort value)

##### Parameters

Type | Name | Description
--- | --- | ---
ushort | value |

#### Put(uint)

##### Declaration

    public void Put(uint value)

##### Parameters

Type | Name | Description
--- | --- | ---
uint | value |

#### Put(ulong)

##### Declaration

    public void Put(ulong value)

##### Parameters

Type | Name | Description
--- | --- | ---
ulong | value |

#### PutArray(bool[])

##### Declaration

    public void PutArray(bool[] value)

##### Parameters

Type | Name | Description
--- | --- | ---
bool[] | value |

#### PutArray(double[])

##### Declaration

    public void PutArray(double[] value)

##### Parameters

Type | Name | Description
--- | --- | ---
double[] | value |

#### PutArray(short[])

##### Declaration

    public void PutArray(short[] value)

##### Parameters

Type | Name | Description
--- | --- | ---
short[] | value |

#### PutArray(int[])

##### Declaration

    public void PutArray(int[] value)

##### Parameters

Type | Name | Description
--- | --- | ---
int[] | value |

#### PutArray(long[])

##### Declaration

    public void PutArray(long[] value)

##### Parameters

Type | Name | Description
--- | --- | ---
long[] | value |

#### PutArray(float[])

##### Declaration

    public void PutArray(float[] value)

##### Parameters

Type | Name | Description
--- | --- | ---
float[] | value |

#### PutArray(string[])

##### Declaration

    public void PutArray(string[] value)

##### Parameters

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

#### PutArray(string[], int)

##### Declaration

    public void PutArray(string[] value, int strMaxLength)

##### Parameters

Type | Name | Description
--- | --- | ---
string[] | value |
int | strMaxLength |

#### PutArray(ushort[])

##### Declaration

    public void PutArray(ushort[] value)

##### Parameters

Type | Name | Description
--- | --- | ---
ushort[] | value |

#### PutArray(uint[])

##### Declaration

    public void PutArray(uint[] value)

##### Parameters

Type | Name | Description
--- | --- | ---
uint[] | value |

#### PutArray(ulong[])

##### Declaration

    public void PutArray(ulong[] value)

##### Parameters

Type | Name | Description
--- | --- | ---
ulong[] | value |

#### PutArray<T>(T[])

##### Declaration

    public void PutArray<T>(T[] value) where T : ISpanSerializable, new()

##### Parameters

Type | Name | Description
--- | --- | ---
T[] | value |

##### Type Parameters

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

#### PutArray<T>(T[], int)

##### Declaration

    public void PutArray<T>(T[] arr, int sz) where T : unmanaged

##### Parameters

Type | Name | Description
--- | --- | ---
T[] | arr |
int | sz |

##### Type Parameters

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

#### PutBytesWithLength(byte[])

##### Declaration

    public void PutBytesWithLength(byte[] data)

##### Parameters

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

#### PutBytesWithLength(byte[], int, ushort)

##### Declaration

    public void PutBytesWithLength(byte[] data, int offset, ushort length)

##### Parameters

Type | Name | Description
--- | --- | ---
byte[] | data |
int | offset |
ushort | length |

#### PutLargeString(string)

##### Declaration

    public void PutLargeString(string value)

##### Parameters

Type | Name | Description
--- | --- | ---
string | value |

#### PutSBytesWithLength(sbyte[])

##### Declaration

    public void PutSBytesWithLength(sbyte[] data)

##### Parameters

Type | Name | Description
--- | --- | ---
sbyte[] | data |

#### PutSBytesWithLength(sbyte[], int, ushort)

##### Declaration

    public void PutSBytesWithLength(sbyte[] data, int offset, ushort length)

##### Parameters

Type | Name | Description
--- | --- | ---
sbyte[] | data |
int | offset |
ushort | length |

#### Put<T>(T)

##### Declaration

    public void Put<T>(T obj) where T : ISpanSerializable

##### Parameters

Type | Name | Description
--- | --- | ---
T | obj |

##### Type Parameters

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