docs: public synchronized void write(final Bits bits) throws IOException {
      Bits newRemainder = this.remainder.concatenate(bits);
      final int newRemainingBits = newRemainder.bitLength % 8;
      int bitsToWrite = newRemainder.bitLength - newRemainingBits;
      if (bitsToWrite > 0) {
        assert (0 == bitsToWrite % 8);
        final Bits toWrite = newRemainder.range(0, bitsToWrite);
        this.inner.write(toWrite.getBytes());
        newRemainder = newRemainder.range(bitsToWrite);
      }
      this.remainder = newRemainder;
      this.totalBitsWritten += bits.bitLength;
    }