code: public int readBit() throws IOException {
          while (true) {
              if (availBits > 0) {
                  int val = ((buffer[getByte] & (0x80 >> getBit)) != 0) ? 1 : 0;
                  getBit++;
                  if (getBit == BITS_PER_BLURB) {
                      readCRC16 = CRC16.update(buffer[getByte], readCRC16);
                      getByte++;
                      getBit = 0;
                  }
                  availBits--;
                  totalBitsRead++;
                  return val;
              } else {
                  readFromStream();
              }
          }
      }
docs: read a single bit.
  @return  The bit
  @throws IOException  Thrown if error reading input stream