/** * Returns <code>true</code> if the end of file has been reached. * * @return true if the end of file has been reached. * @throws IOException if an I/O error occurred */ private boolean eofReached() throws IOException { return offset>=getLength(); }
/** * Calls {@link #readBlock(long, byte[], int)} to read a block of up to <code>blockSize</code>, less if the * the end of file is near. * * @throws IOException if an I/O error occurred */ private void readBlock() throws IOException { int len = Math.min((int)(getLength()-offset), blockSize); // update len with the number of bytes actually read len = readBlock(offset, block, len); // Note: these fields won't be updated if an I/O error occurs this.blockOff = 0; this.blockLen = len; }