public boolean readBit() throws IOException {
  if (bitField == -1) {
    bitField=in.read();
    if (bitField == -1) {
      throw new EOFException();
    }
    mask=1;
  }
  boolean bit=(bitField & mask) != 0;
  if ((mask<<=1) == 0x100) {
    bitField=-1;
  }
  return bit;
}

public boolean readBit ( ) throws IOException { if ( bitField == - 1 ) { bitField = in . read ( ) ; if ( bitField == - 1 ) { throw new EOFException ( ) ; } mask = 1 ; } boolean bit = ( bitField & mask ) != 0 ; if ( ( mask <<= 1 ) == 0x100 ) { bitField = - 1 ; } return bit ; }
read one bit from the stream in little endian order . < p > consecutive calls to this method will consume one bit at a time from the underlying stream . if any of the other read methods are called all remaining bits up to the next byte boundary will be discarded .
