Writes bit-packed data to a ksStreamBuffer.
More...
Writes bit-packed data to a ksStreamBuffer.
When you are done writing all your data, you must call Flush to ensure the last byte of data is written. Read the data using a ksBitReader.
◆ ksBitWriter()
Constructor
- Parameters
-
| buffer | Buffer to write to. |
◆ Flush()
| void KS.Reactor.ksBitWriter.Flush |
( |
| ) |
|
Flushes the current byte to the buffer. Subsequent writes will write to the next byte.
◆ Write()
| void KS.Reactor.ksBitWriter.Write |
( |
bool |
value | ) |
|
Writes 1 bit to the buffer.
- Parameters
-
| value | Value to write. True = 1, False = 0. |
◆ WriteBits()
| void KS.Reactor.ksBitWriter.WriteBits |
( |
uint |
input, |
|
|
int |
bits |
|
) |
| |
Writes up to 32 bits into the buffer.
- Parameters
-
| input | input to write bits from. |
| bits | number of bits from input to write. |
◆ WriteBits64()
| void KS.Reactor.ksBitWriter.WriteBits64 |
( |
ulong |
input, |
|
|
int |
bits |
|
) |
| |
Writes up to 64 bits into the buffer.
- Parameters
-
| input | input to write bits from. |
| bits | number of bits from input to write. |