This output buffer converts each written element into one or two byte arrays and adds them to a list. More...
Public Member Functions | |
void | WriteBytes (byte[] bytes) |
Writes bytes to the buffer. More... | |
void | Write (bool value) |
Writes a bool to the buffer. More... | |
void | Write< T > (T value) |
Writes a struct of type T to the buffer. More... | |
void | Write (byte value) |
Writes a byte to the buffer. More... | |
void | Write (char value) |
Writes a char to the buffer. 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 a 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 (string value) |
Writes a string to the buffer. More... | |
void | Write (bool[] value) |
Writes an array of bools to the buffer. More... | |
void | Write (byte[] value) |
Writes an array of bytes to the buffer. More... | |
void | Write (char[] value) |
Writes an array of chars to the buffer. More... | |
void | Write (short[] value) |
Writes an array of shorts to the buffer. More... | |
void | Write (ushort[] value) |
Writes an array of ushort to the buffer. More... | |
void | Write (int[] value) |
Writes an array of ints to the buffer. More... | |
void | Write (uint[] value) |
Writes an array of uints to the buffer. More... | |
void | Write (long[] value) |
Writes an array of longs to the buffer. More... | |
void | Write (ulong[] value) |
Write an array of ulongs to the buffer. More... | |
void | Write (float[] value) |
Writes an array of floats to the buffer. More... | |
void | Write (double[] value) |
Writes an array of doubles to the buffer. More... | |
void | Write (string[] value) |
Writes an array of strings to the buffer. More... | |
void | Write (ksOutputBuffer value) |
Appends the contents of another output buffer. More... | |
void | Write (ksIBufferable value) |
Writes the bytes of an object that implemented ksIBufferable. More... | |
void | Write (ksMultiType value) |
Writes a ksMultitype to the buffer. More... | |
void | Clear () |
Clears the buffer. More... | |
byte[] | GetBytes () |
Copies and returns the contents of the buffer as a single byte array. More... | |
byte[] | Flush () |
Gets the buffer bytes then clear the buffer. More... | |
Properties | |
List< byte[]> | Subbuffers [get] |
Gets the list of subbuffers(byte[]) that make up the buffer. More... | |
int | Length [get] |
Gets the current byte length of the buffer. More... | |
This output buffer converts each written element into one or two byte arrays and adds them to a list.
When the output is requested, by calls to GetBytes() or Flush(), the list of byte arrays is copied to a single byte array. This approach is significatly faster for large amounts of data when compared to using memory streams or resizing an array for each write operation.
void KS.Reactor.ksOutputBuffer.Clear | ( | ) |
Clears the buffer.
byte [] KS.Reactor.ksOutputBuffer.Flush | ( | ) |
Gets the buffer bytes then clear the buffer.
byte [] KS.Reactor.ksOutputBuffer.GetBytes | ( | ) |
Copies and returns the contents of the buffer as a single byte array.
void KS.Reactor.ksOutputBuffer.Write | ( | bool | value | ) |
Writes a bool to the buffer.
value | Bool to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | bool[] | value | ) |
Writes an array of bools to the buffer.
Values are first converted to a bit array before writing. If the array is null, then a length of -1 is written.
value | Bool array to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | byte | value | ) |
Writes a byte to the buffer.
value | Byte to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | byte[] | value | ) |
Writes an array of bytes to the buffer.
value | Byte array to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | char | value | ) |
Writes a char to the buffer.
value | Char to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | char[] | value | ) |
Writes an array of chars to the buffer.
value | Char array to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | double | value | ) |
Writes a double to the buffer.
value | Double to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | double[] | value | ) |
Writes an array of doubles to the buffer.
value | Double array to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | float | value | ) |
Writes a float to the buffer.
value | Float to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | float[] | value | ) |
Writes an array of floats to the buffer.
value | Float array to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | int | value | ) |
Writes a int to the buffer.
value | Int to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | int[] | value | ) |
Writes an array of ints to the buffer.
value | Int array to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | ksIBufferable | value | ) |
Writes the bytes of an object that implemented ksIBufferable.
If the object is null write a length value of -1.
value | Value to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | ksMultiType | value | ) |
Writes a ksMultitype to the buffer.
value | Value to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | ksOutputBuffer | value | ) |
Appends the contents of another output buffer.
value | Value to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | long | value | ) |
Writes a long to the buffer.
value | Long to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | long[] | value | ) |
Writes an array of longs to the buffer.
value | Long array to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | short | value | ) |
Writes a short to the buffer.
value | Short to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | short[] | value | ) |
Writes an array of shorts to the buffer.
value | Short array to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | string | value | ) |
Writes a string to the buffer.
value | String to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | string[] | value | ) |
Writes an array of strings to the buffer.
Writes the length of the array followed by each string. If the array is null, then a length of -1 is written.
value | String array to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | uint | value | ) |
Writes a uint to the buffer.
value | Uint to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | uint[] | value | ) |
Writes an array of uints to the buffer.
value | Uint array to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | ulong | value | ) |
Writes a ulong to the buffer.
value | Ulong to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | ulong[] | value | ) |
Write an array of ulongs to the buffer.
value | Ulong array to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | ushort | value | ) |
Writes a ushort to the buffer.
value | Ushort to write. |
void KS.Reactor.ksOutputBuffer.Write | ( | ushort[] | value | ) |
Writes an array of ushort to the buffer.
value | Ushort array to write. |
void KS.Reactor.ksOutputBuffer.Write< T > | ( | T | value | ) |
Writes a struct of type T to the buffer.
T |
value | Struct to write. |
T | : | struct |
void KS.Reactor.ksOutputBuffer.WriteBytes | ( | byte[] | bytes | ) |
Writes bytes to the buffer.
bytes | Bytes to write. |
|
get |
Gets the current byte length of the buffer.
|
get |
Gets the list of subbuffers(byte[]) that make up the buffer.