|
ADPCM Codecs
|
Writes bits into a buffer. By default the first bit written is the least significant bit of the first byte. With setMsbFirst(true) the first bit written is the most significant bit of the first byte. Call flush() to store a partial last byte. Writes beyond the buffer size are dropped. More...
#include <BitWriter.h>
Public Member Functions | |
| BitWriter (uint8_t *buffer, int buffer_size) | |
| void | setMsbFirst (bool msb) |
| Selects the bit order used by put(); call before writing. | |
| void | put (int n, uint32_t value) |
| writes the low n bits of value (0 to 32) | |
| void | putSigned (int n, int32_t value) |
| writes the low n bits of a signed value (two's complement, 0 to 31) | |
| void | flush () |
| stores the pending bits as a final, zero padded byte | |
| int | bytesWritten () const |
| number of bytes stored so far | |
Writes bits into a buffer. By default the first bit written is the least significant bit of the first byte. With setMsbFirst(true) the first bit written is the most significant bit of the first byte. Call flush() to store a partial last byte. Writes beyond the buffer size are dropped.