public byte readBitField ( final JBBPBitNumber numOfBitsToRead ) throws IOException { final int value = this . readBits ( numOfBitsToRead ) ; if ( value < 0 ) { throw new EOFException ( "Can't read bits from stream [" + numOfBitsToRead + ' ' ) ; } return ( byte ) value ; }
Read bit field from the stream if it is impossible then IOException will be thrown .