writeBit method

int writeBit(
  1. bool bit
)

Writes a bit (true: 1 ; false: 0). Returns the number of bits successfully written into the buffer.

Note that a byte is written to the internal bytesBuffer for every 8 accumulated bits. See writeBits and unflushedBitsLength.

Implementation

int writeBit(bool bit) {
  return writeBits(bit ? 1 : 0, 1);
}