public int read() {
        if (buffer == null)
            throw new AssertionError("Attempted to read from closed RAR");

        if (isEOF())
            return -1; // required by RandomAccessFile

        if (current >= bufferOffset + buffer.length || validBufferBytes == -1)
            reBuffer();

        assert current >= bufferOffset && current < bufferOffset + validBufferBytes;

        return ((int) buffer[(int) (current++ - bufferOffset)]) & 0xff;
    }
public int read ( ) { if ( buffer == null ) throw new AssertionError ( "Attempted to read from closed RAR" ) ; if ( isEOF ( ) ) return - 1 ; if ( current >= bufferOffset + buffer . length || validBufferBytes == - 1 ) reBuffer ( ) ; assert current >= bufferOffset && current < bufferOffset + validBufferBytes ; return ( ( int ) buffer [ ( int ) ( current ++ - bufferOffset ) ] ) & 0xff ; }
or readFully (from RandomAccessFile) will throw EOFException but this should not