Manages a buffer for reading and writing stream data to a byte array. More...
Classes | |
| class | Segment |
| Represents a segment of a ksStreamBuffer. More... | |
Public Member Functions | |
| ksStreamBuffer () | |
| Constructor More... | |
| ksStreamBuffer (byte[] data) | |
| Constructor More... | |
| void | Clear (bool zero=false) |
| Clears all data from the buffer. More... | |
| void | ResizeBuffer (int size) |
| Resizes and zeros the used portion of the manage array. More... | |
| int | Reserve (int size) |
| Reserves space to write to later by advancing the write offset by size , growing the buffer if necessary. More... | |
| void | Write (byte value) |
| Writes a byte value at the current buffer write offset. More... | |
| void | WriteBytes (byte[] value) |
| Writes a byte array at the current buffer write offset. More... | |
| void | Write (ArraySegment< byte > segment) |
| Writes a segment of a byte array to the buffer. More... | |
| void | Write (sbyte value) |
| Writes an sbyte value at the current buffer write offset. More... | |
| void | Write (short value) |
| Writes a short to the buffer. More... | |
| void | Write (ushort value) |
| Writes a ushort to the buffer. More... | |
| void | Write (int value) |
| Writes an int to the buffer. More... | |
| void | Write (uint value) |
| Writes a uint to the buffer. More... | |
| void | Write (long value) |
| Writes a long to the buffer. More... | |
| void | Write (ulong value) |
| Writes a ulong to the buffer. More... | |
| void | Write (float value) |
| Writes a float to the buffer. More... | |
| void | Write (double value) |
| Writes a double to the buffer. More... | |
| void | Write (char value) |
| Writes a char to the buffer. More... | |
| void | Write (bool value) |
| Writes a bool to the buffer. More... | |
| void | Write (string value) |
| Writes a string to the buffer. More... | |
| void | Write< T > (T value) |
| Writes a struct to the buffer. More... | |
| void | Write (ksISerializable serializable) |
| Writes a ksISerializable to the buffer. More... | |
| void | Write (ksMultiType value) |
| Writes a ksMultiType to the buffer. More... | |
| void | Write (byte[] array) |
| Writes a byte array to the buffer along with its size. More... | |
| void | Write (sbyte[] array) |
| Writes an sbyte array to the buffer along with its size. More... | |
| void | Write (short[] array) |
| Writes a short array to the buffer along with its size. More... | |
| void | Write (ushort[] array) |
| Writes a ushort array to the buffer along with its size. More... | |
| void | Write (int[] array) |
| Writes an int array to the buffer along with its size. More... | |
| void | Write (uint[] array) |
| Writes a uint array to the buffer along with its size. More... | |
| void | Write (long[] array) |
| Writes a long array to the buffer along with its size. More... | |
| void | Write (ulong[] array) |
| Writes a ulong array to the buffer along with its size. More... | |
| void | Write (float[] array) |
| Writes a float array to the buffer along with its size. More... | |
| void | Write (double[] array) |
| Writes a double array to the buffer along with its size. More... | |
| void | Write (char[] array) |
| Writes a char array to the buffer along with its size. More... | |
| void | Write (bool[] array) |
| Writes a bool array to the buffer along with its size. More... | |
| void | Write (string[] array) |
| Writes a string array to the buffer along with its size. More... | |
| void | Write< T > (T[] array) |
| Writes a struct T array to the buffer along with its size. More... | |
| void | Write (ksMultiType[] array) |
| Writes an array of multitypes to the buffer. More... | |
| void | WriteSerializableArray< T > (T[] array) |
| Writes an array of T that implement ksISerializable to the buffer along with its size. More... | |
| void | WriteEncodedValue (int value) |
| Writes an int to the buffer using 7-bit encoding. More... | |
| void | WriteEncodedValue (uint value) |
| Writes a uint to the buffer using 7-bit encoding. More... | |
| void | WriteEncodedValue (long value) |
| Writes a long to the buffer using 7-bit encoding. More... | |
| void | WriteEncodedValue (ulong value) |
| Writes a ulong to the buffer using 7-bit encoding. More... | |
| void | WriteInt24 (int value) |
| Writes an int using 3 bytes. More... | |
| void | WriteUInt24 (uint value) |
| Writes a uint using 3 bytes. More... | |
| void | WriteInt48 (long value) |
| Writes a long using 6 bytes. More... | |
| void | WriteUInt48 (ulong value) |
| Writes a ulong using 6 bytes. More... | |
| void | WriteEncodedArray (int[] array) |
| Writes an int array to the buffer using 7-bit encoding. More... | |
| void | WriteEncodedArray (uint[] array) |
| Writes a uint array to the buffer using 7-bit encoding. More... | |
| void | WriteEncodedArray (long[] array) |
| Writes a long array to the buffer using 7-bit encoding. More... | |
| void | WriteEncodedArray (ulong[] array) |
| Writes a ulong array to the buffer using 7-bit encoding. More... | |
| byte | Read () |
| Reads the byte at the current buffer read offset. More... | |
| byte | ReadByte () |
| Reads the byte at the current buffer read offset. More... | |
| sbyte | ReadSByte () |
| Reads an sbyte from the buffer. More... | |
| byte[] | ReadBytes (int count=-1) |
| Reads multiple bytes at the current buffer read offset. More... | |
| short | ReadShort () |
| Reads a short from the buffer. More... | |
| ushort | ReadUShort () |
| Reads a ushort from the buffer. More... | |
| int | ReadInt () |
| Reads an int from the buffer. More... | |
| uint | ReadUInt () |
| Reads a uint from the buffer. More... | |
| long | ReadLong () |
| Reads a long from the buffer. More... | |
| ulong | ReadULong () |
| Reads a ulong from the buffer. More... | |
| float | ReadFloat () |
| Reads a float from the buffer. More... | |
| double | ReadDouble () |
| Reads a double from the buffer. More... | |
| char | ReadChar () |
| Reads a char from the buffer. More... | |
| bool | ReadBool () |
| Reads a bool from the buffer. More... | |
| string | ReadString () |
| Reads a string from the buffer. More... | |
| T | Read< T > () |
| Reads a struct from the buffer. More... | |
| T | ReadSerializable< T > () |
| Reads a T that implements ksISerializable from the buffer. More... | |
| ksMultiType | ReadMultiType () |
| Reads a ksMultiType from the buffer. More... | |
| byte[] | ReadByteArray () |
| Reads a byte array from the buffer. More... | |
| sbyte[] | ReadSByteArray () |
| Reads an sbyte array from the buffer. More... | |
| short[] | ReadShortArray () |
| Reads a short array from the buffer. More... | |
| ushort[] | ReadUShortArray () |
| Reads a ushort array from the buffer. More... | |
| int[] | ReadIntArray () |
| Reads an int array from the buffer. More... | |
| uint[] | ReadUIntArray () |
| Reads a uint array from the buffer. More... | |
| long[] | ReadLongArray () |
| Reads a long array from the buffer. More... | |
| ulong[] | ReadULongArray () |
| Reads a ulong array from the buffer. More... | |
| float[] | ReadFloatArray () |
| Reads a float array from the buffer. More... | |
| double[] | ReadDoubleArray () |
| Reads a double array from the buffer. More... | |
| char[] | ReadCharArray () |
| Reads a char array from the buffer. More... | |
| bool[] | ReadBoolArray () |
| Reads a bool array from the buffer. More... | |
| string[] | ReadStringArray () |
| Reads a string array from the buffer. More... | |
| T[] | ReadArray< T > () |
| Reads a struct array from the buffer. More... | |
| ksMultiType[] | ReadMultiTypeArray () |
| Reads a ksMultiType array from the buffer. More... | |
| T[] | ReadSerializableArray< T > () |
| Reads an array of T that implement ksISerializable from the buffer. More... | |
| int | ReadEncodedInt () |
| Reads an int from the buffer using 7-bit encoding. More... | |
| uint | ReadEncodedUInt () |
| Reads a uint from the buffer using 7-bit encoding. More... | |
| long | ReadEncodedLong () |
| Reads a long from the buffer using 7-bit encoding. More... | |
| ulong | ReadEncodedULong () |
| Reads a ulong from the buffer using 7-bit encoding. More... | |
| int | ReadInt24 () |
| Reads an int using 3 bytes. More... | |
| uint | ReadUInt24 () |
| Reads a uint using 3 bytes. More... | |
| long | ReadInt48 () |
| Reads a long using 6 bytes. More... | |
| ulong | ReadUInt48 () |
| Reads a ulong using 6 bytes. More... | |
| int[] | ReadEncodedIntArray () |
| Reads an int array from the buffer using 7-bit encoding. More... | |
| uint[] | ReadEncodedUIntArray () |
| Reads a uint array from the buffer using 7-bit encoding. More... | |
| long[] | ReadEncodedLongArray () |
| Reads a long array from the buffer using 7-bit encoding. More... | |
| ulong[] | ReadEncodedULongArray () |
| Reads a ulong array from the buffer using 7-bit encoding. More... | |
| byte[] | ToArray () |
| Copies and returns the contents of the buffer. More... | |
| byte[] | CopyAndRelease () |
| Copies and returns the contents of the buffer, and releases the buffer into the pool of available buffers. More... | |
| byte[] | Flush () |
| Copies and returns the contents of the buffer, and clears the buffer. More... | |
| bool | TryGetSegment (out Segment segment, int offset=0, int count=-1) |
| Attempts to get a segment of the buffer. More... | |
| Segment | GetSegment (int offset=0, int count=-1) |
| Gets a segment of the buffer. More... | |
| bool | TryRelease () |
| Tries to release the buffer into the pool of available buffers. More... | |
| void | Release () |
| Releases the buffer and put it pool of available buffers. More... | |
Static Public Member Functions | |
| static ksStreamBuffer | Create () |
| Fetches a ksStreamBuffer from a pool of available buffers or create a new ksStreamBuffer if the pool is empty. More... | |
Static Public Attributes | |
| static int | INT24_MIN = -(1 << 23) |
| Min value that can be written using WriteInt24(ksIOutputStream, int). More... | |
| static int | INT24_MAX = (1 << 23) - 1 |
| Max value that can be written using WriteInt24(ksIOutputStream, int). More... | |
| static uint | UINT24_MAX = (1 << 24) - 1 |
| Max value that can be written using WriteUInt24(ksIOutputStream, uint). More... | |
| static long | INT48_MIN = -((long)1 << 47) |
| Min value that can be written using WriteInt48(ksIOutputStream, long). More... | |
| static long | INT48_MAX = ((long)1 << 47) - 1 |
| Max value that can be written using WriteInt48(ksIOutputStream, long). More... | |
| static ulong | UINT48_MAX = ((ulong)1 << 48) - 1 |
| Max value that can be written using WriteUInt48(ksIOutputStream, ulong). More... | |
Properties | |
| byte[] | Array [get] |
| Byte array managed by the stream buffer. More... | |
| int | Count [get] |
| Amount of data in the managed array used by the buffer. More... | |
| int | WriteOffset [get, set] |
| Current position of the write cursor in the buffer. More... | |
| int | ReadOffset [get, set] |
| Current position of the read cursor in the buffer. More... | |
| int | Offset [get, set] |
Manages a buffer for reading and writing stream data to a byte array.
| KS.Reactor.ksStreamBuffer.ksStreamBuffer | ( | ) |
Constructor
| KS.Reactor.ksStreamBuffer.ksStreamBuffer | ( | byte[] | data | ) |
Constructor
| data | Buffer data |
| void KS.Reactor.ksStreamBuffer.Clear | ( | bool | zero = false | ) |
Clears all data from the buffer.
| zero | If this is true, all bytes in the managed array will be set to 0. |
| byte [] KS.Reactor.ksStreamBuffer.CopyAndRelease | ( | ) |
Copies and returns the contents of the buffer, and releases the buffer into the pool of available buffers.
|
static |
Fetches a ksStreamBuffer from a pool of available buffers or create a new ksStreamBuffer if the pool is empty.
| byte [] KS.Reactor.ksStreamBuffer.Flush | ( | ) |
Copies and returns the contents of the buffer, and clears the buffer.
| Segment KS.Reactor.ksStreamBuffer.GetSegment | ( | int | offset = 0, |
| int | count = -1 |
||
| ) |
| byte KS.Reactor.ksStreamBuffer.Read | ( | ) |
Reads the byte at the current buffer read offset.
| T KS.Reactor.ksStreamBuffer.Read< T > | ( | ) |
Reads a struct from the buffer.
| T | Struct type |
| T | : | struct |
| T [] KS.Reactor.ksStreamBuffer.ReadArray< T > | ( | ) |
Reads a struct array from the buffer.
| T | Struct type |
| T | : | struct |
| bool KS.Reactor.ksStreamBuffer.ReadBool | ( | ) |
Reads a bool from the buffer.
| bool [] KS.Reactor.ksStreamBuffer.ReadBoolArray | ( | ) |
Reads a bool array from the buffer.
| byte KS.Reactor.ksStreamBuffer.ReadByte | ( | ) |
Reads the byte at the current buffer read offset.
| byte [] KS.Reactor.ksStreamBuffer.ReadByteArray | ( | ) |
Reads a byte array from the buffer.
| byte [] KS.Reactor.ksStreamBuffer.ReadBytes | ( | int | count = -1 | ) |
Reads multiple bytes at the current buffer read offset.
| count | Number of bytes to read (-1 = up to the end of the buffer). |
| char KS.Reactor.ksStreamBuffer.ReadChar | ( | ) |
Reads a char from the buffer.
| char [] KS.Reactor.ksStreamBuffer.ReadCharArray | ( | ) |
Reads a char array from the buffer.
| double KS.Reactor.ksStreamBuffer.ReadDouble | ( | ) |
Reads a double from the buffer.
| double [] KS.Reactor.ksStreamBuffer.ReadDoubleArray | ( | ) |
Reads a double array from the buffer.
| int KS.Reactor.ksStreamBuffer.ReadEncodedInt | ( | ) |
Reads an int from the buffer using 7-bit encoding.
7 bits of the value are read at a time, and the 8th bit indicates if there is more data to read.
| int [] KS.Reactor.ksStreamBuffer.ReadEncodedIntArray | ( | ) |
Reads an int array from the buffer using 7-bit encoding.
7 bits of each value are read at a time, and the 8th bit indicates if there is more data to read.
| long KS.Reactor.ksStreamBuffer.ReadEncodedLong | ( | ) |
Reads a long from the buffer using 7-bit encoding.
7 bits of the value are read at a time, and the 8th bit indicates if there is more data to read.
| long [] KS.Reactor.ksStreamBuffer.ReadEncodedLongArray | ( | ) |
Reads a long array from the buffer using 7-bit encoding.
7 bits of each value are read at a time, and the 8th bit indicates if there is more data to read.
| uint KS.Reactor.ksStreamBuffer.ReadEncodedUInt | ( | ) |
Reads a uint from the buffer using 7-bit encoding.
7 bits of the value are read at a time, and the 8th bit indicates if there is more data to read.
| uint [] KS.Reactor.ksStreamBuffer.ReadEncodedUIntArray | ( | ) |
Reads a uint array from the buffer using 7-bit encoding.
7 bits of each value are read at a time, and the 8th bit indicates if there is more data to read.
| ulong KS.Reactor.ksStreamBuffer.ReadEncodedULong | ( | ) |
Reads a ulong from the buffer using 7-bit encoding.
7 bits of the value are read at a time, and the 8th bit indicates if there is more data to read.
| ulong [] KS.Reactor.ksStreamBuffer.ReadEncodedULongArray | ( | ) |
Reads a ulong array from the buffer using 7-bit encoding.
7 bits of each value are read at a time, and the 8th bit indicates if there is more data to read.
| float KS.Reactor.ksStreamBuffer.ReadFloat | ( | ) |
Reads a float from the buffer.
| float [] KS.Reactor.ksStreamBuffer.ReadFloatArray | ( | ) |
Reads a float array from the buffer.
| int KS.Reactor.ksStreamBuffer.ReadInt | ( | ) |
Reads an int from the buffer.
| int KS.Reactor.ksStreamBuffer.ReadInt24 | ( | ) |
Reads an int using 3 bytes.
| long KS.Reactor.ksStreamBuffer.ReadInt48 | ( | ) |
Reads a long using 6 bytes.
| int [] KS.Reactor.ksStreamBuffer.ReadIntArray | ( | ) |
Reads an int array from the buffer.
| long KS.Reactor.ksStreamBuffer.ReadLong | ( | ) |
Reads a long from the buffer.
| input | Input to read from. |
| long [] KS.Reactor.ksStreamBuffer.ReadLongArray | ( | ) |
Reads a long array from the buffer.
| ksMultiType KS.Reactor.ksStreamBuffer.ReadMultiType | ( | ) |
Reads a ksMultiType from the buffer.
| ksMultiType [] KS.Reactor.ksStreamBuffer.ReadMultiTypeArray | ( | ) |
Reads a ksMultiType array from the buffer.
| sbyte KS.Reactor.ksStreamBuffer.ReadSByte | ( | ) |
Reads an sbyte from the buffer.
| sbyte [] KS.Reactor.ksStreamBuffer.ReadSByteArray | ( | ) |
Reads an sbyte array from the buffer.
| T KS.Reactor.ksStreamBuffer.ReadSerializable< T > | ( | ) |
Reads a T that implements ksISerializable from the buffer.
| T | Type to read. |
| T | : | ksISerializable | |
| T | : | new() |
| T [] KS.Reactor.ksStreamBuffer.ReadSerializableArray< T > | ( | ) |
Reads an array of T that implement ksISerializable from the buffer.
| T | Type that implements ksISerializable |
| T | : | ksISerializable | |
| T | : | new() |
| short KS.Reactor.ksStreamBuffer.ReadShort | ( | ) |
Reads a short from the buffer.
| short [] KS.Reactor.ksStreamBuffer.ReadShortArray | ( | ) |
Reads a short array from the buffer.
| string KS.Reactor.ksStreamBuffer.ReadString | ( | ) |
Reads a string from the buffer.
| string [] KS.Reactor.ksStreamBuffer.ReadStringArray | ( | ) |
Reads a string array from the buffer.
| uint KS.Reactor.ksStreamBuffer.ReadUInt | ( | ) |
Reads a uint from the buffer.
| uint KS.Reactor.ksStreamBuffer.ReadUInt24 | ( | ) |
Reads a uint using 3 bytes.
| ulong KS.Reactor.ksStreamBuffer.ReadUInt48 | ( | ) |
Reads a ulong using 6 bytes.
| uint [] KS.Reactor.ksStreamBuffer.ReadUIntArray | ( | ) |
Reads a uint array from the buffer.
| ulong KS.Reactor.ksStreamBuffer.ReadULong | ( | ) |
Reads a ulong from the buffer.
| ulong [] KS.Reactor.ksStreamBuffer.ReadULongArray | ( | ) |
Reads a ulong array from the buffer.
| ushort KS.Reactor.ksStreamBuffer.ReadUShort | ( | ) |
Reads a ushort from the buffer.
| ushort [] KS.Reactor.ksStreamBuffer.ReadUShortArray | ( | ) |
Reads a ushort array from the buffer.
| void KS.Reactor.ksStreamBuffer.Release | ( | ) |
Releases the buffer and put it pool of available buffers.
Throws an exception if the buffer has unreleased segments.
| int KS.Reactor.ksStreamBuffer.Reserve | ( | int | size | ) |
Reserves space to write to later by advancing the write offset by size , growing the buffer if necessary.
| size | Size to reserve for writing later. |
| void KS.Reactor.ksStreamBuffer.ResizeBuffer | ( | int | size | ) |
Resizes and zeros the used portion of the manage array.
| size | New size. |
| byte [] KS.Reactor.ksStreamBuffer.ToArray | ( | ) |
Copies and returns the contents of the buffer.
| bool KS.Reactor.ksStreamBuffer.TryGetSegment | ( | out Segment | segment, |
| int | offset = 0, |
||
| int | count = -1 |
||
| ) |
| bool KS.Reactor.ksStreamBuffer.TryRelease | ( | ) |
Tries to release the buffer into the pool of available buffers.
The buffer cannot be released if it has any unreleased segments or if it's size is too large or the pool is full.
| void KS.Reactor.ksStreamBuffer.Write | ( | ArraySegment< byte > | segment | ) |
Writes a segment of a byte array to the buffer.
| segment | Segment to write. |
| void KS.Reactor.ksStreamBuffer.Write | ( | bool | value | ) |
Writes a bool to the buffer.
| value | Value to write. |
| void KS.Reactor.ksStreamBuffer.Write | ( | bool[] | array | ) |
Writes a bool array to the buffer along with its size.
| output | Output to write to. |
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | byte | value | ) |
Writes a byte value at the current buffer write offset.
| value |
| void KS.Reactor.ksStreamBuffer.Write | ( | byte[] | array | ) |
Writes a byte array to the buffer along with its size.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | char | value | ) |
Writes a char to the buffer.
| value | Value to write. |
| void KS.Reactor.ksStreamBuffer.Write | ( | char[] | array | ) |
Writes a char array to the buffer along with its size.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | double | value | ) |
Writes a double to the buffer.
| value | Value to write. |
| void KS.Reactor.ksStreamBuffer.Write | ( | double[] | array | ) |
Writes a double array to the buffer along with its size.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | float | value | ) |
Writes a float to the buffer.
| value | Value to write. |
| void KS.Reactor.ksStreamBuffer.Write | ( | float[] | array | ) |
Writes a float array to the buffer along with its size.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | int | value | ) |
Writes an int to the buffer.
| value | Value to write. |
| void KS.Reactor.ksStreamBuffer.Write | ( | int[] | array | ) |
Writes an int array to the buffer along with its size.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | ksISerializable | serializable | ) |
Writes a ksISerializable to the buffer.
| value | Value to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | ksMultiType | value | ) |
Writes a ksMultiType to the buffer.
| value | Value to write. |
| void KS.Reactor.ksStreamBuffer.Write | ( | ksMultiType[] | array | ) |
Writes an array of multitypes to the buffer.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | long | value | ) |
Writes a long to the buffer.
| value | Value to write. |
| void KS.Reactor.ksStreamBuffer.Write | ( | long[] | array | ) |
Writes a long array to the buffer along with its size.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | sbyte | value | ) |
Writes an sbyte value at the current buffer write offset.
| value |
| void KS.Reactor.ksStreamBuffer.Write | ( | sbyte[] | array | ) |
Writes an sbyte array to the buffer along with its size.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | short | value | ) |
Writes a short to the buffer.
| value | Value to write. |
| void KS.Reactor.ksStreamBuffer.Write | ( | short[] | array | ) |
Writes a short array to the buffer along with its size.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | string | value | ) |
Writes a string to the buffer.
| value | Value to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | string[] | array | ) |
Writes a string array to the buffer along with its size.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | uint | value | ) |
Writes a uint to the buffer.
| value | Value to write. |
| void KS.Reactor.ksStreamBuffer.Write | ( | uint[] | array | ) |
Writes a uint array to the buffer along with its size.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | ulong | value | ) |
Writes a ulong to the buffer.
| value | Value to write. |
| void KS.Reactor.ksStreamBuffer.Write | ( | ulong[] | array | ) |
Writes a ulong array to the buffer along with its size.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write | ( | ushort | value | ) |
Writes a ushort to the buffer.
| value | Value to write. |
| void KS.Reactor.ksStreamBuffer.Write | ( | ushort[] | array | ) |
Writes a ushort array to the buffer along with its size.
| array | Array to write. May be null. |
| void KS.Reactor.ksStreamBuffer.Write< T > | ( | T | value | ) |
Writes a struct to the buffer.
| T | Struct type |
| value | Value to write. |
| T | : | struct |
| void KS.Reactor.ksStreamBuffer.Write< T > | ( | T[] | array | ) |
Writes a struct T array to the buffer along with its size.
| T | Struct type |
| array | Array to write. May be null. |
| T | : | struct |
| void KS.Reactor.ksStreamBuffer.WriteBytes | ( | byte[] | value | ) |
Writes a byte array at the current buffer write offset.
| value |
| void KS.Reactor.ksStreamBuffer.WriteEncodedArray | ( | int[] | array | ) |
Writes an int array to the buffer using 7-bit encoding.
7 bits of each value are written at a time, and the 8th bit indicates if there is more data to read.
| array | Array to encode. May be null. |
| void KS.Reactor.ksStreamBuffer.WriteEncodedArray | ( | long[] | array | ) |
Writes a long array to the buffer using 7-bit encoding.
7 bits of each value are written at a time, and the 8th bit indicates if there is more data to read.
| array | Array to encode. May be null. |
| void KS.Reactor.ksStreamBuffer.WriteEncodedArray | ( | uint[] | array | ) |
Writes a uint array to the buffer using 7-bit encoding.
7 bits of each value are written at a time, and the 8th bit indicates if there is more data to read.
| array | Array to encode. May be null. |
| void KS.Reactor.ksStreamBuffer.WriteEncodedArray | ( | ulong[] | array | ) |
Writes a ulong array to the buffer using 7-bit encoding.
7 bits of each value are written at a time, and the 8th bit indicates if there is more data to read.
| array | Array to encode. May be null. |
| void KS.Reactor.ksStreamBuffer.WriteEncodedValue | ( | int | value | ) |
Writes an int to the buffer using 7-bit encoding.
7 bits of the value are written at a time, and the 8th bit indicates if there is more data to read.
| value | Value to encode. |
| void KS.Reactor.ksStreamBuffer.WriteEncodedValue | ( | long | value | ) |
Writes a long to the buffer using 7-bit encoding.
7 bits of the value are written at a time, and the 8th bit indicates if there is more data to read.
| value | Value to encode. |
| void KS.Reactor.ksStreamBuffer.WriteEncodedValue | ( | uint | value | ) |
Writes a uint to the buffer using 7-bit encoding.
7 bits of the value are written at a time, and the 8th bit indicates if there is more data to read.
| value | Value to encode. |
| void KS.Reactor.ksStreamBuffer.WriteEncodedValue | ( | ulong | value | ) |
Writes a ulong to the buffer using 7-bit encoding.
7 bits of the value are written at a time, and the 8th bit indicates if there is more data to read.
| value | Value to encode. |
| void KS.Reactor.ksStreamBuffer.WriteInt24 | ( | int | value | ) |
| void KS.Reactor.ksStreamBuffer.WriteInt48 | ( | long | value | ) |
| void KS.Reactor.ksStreamBuffer.WriteSerializableArray< T > | ( | T[] | array | ) |
Writes an array of T that implement ksISerializable to the buffer along with its size.
| T | Type that implements ksISerializable |
| array | Array to write. May be null. |
| T | : | ksISerializable |
| void KS.Reactor.ksStreamBuffer.WriteUInt24 | ( | uint | value | ) |
Writes a uint using 3 bytes.
UINT24_MAX is the max value that can be written.
| value | Value to write. |
| void KS.Reactor.ksStreamBuffer.WriteUInt48 | ( | ulong | value | ) |
Writes a ulong using 6 bytes.
UINT48_MAX is the max value that can be written.
| value | Value to write. |
|
static |
Max value that can be written using WriteInt24(ksIOutputStream, int).
|
static |
Min value that can be written using WriteInt24(ksIOutputStream, int).
|
static |
Max value that can be written using WriteInt48(ksIOutputStream, long).
|
static |
Min value that can be written using WriteInt48(ksIOutputStream, long).
|
static |
Max value that can be written using WriteUInt24(ksIOutputStream, uint).
|
static |
Max value that can be written using WriteUInt48(ksIOutputStream, ulong).
|
get |
Byte array managed by the stream buffer.
Note: active buffers may only be using up to Count bytes of this array.
|
get |
Amount of data in the managed array used by the buffer.
|
getset |
Current position of the read cursor in the buffer.
All read operations will access the managed array at this position.
|
getset |
Current position of the write cursor in the buffer.
All write operations will access the managed array at this position.