/** * Skip a specified number of bytes. * * @param numberOfBytes The number of bytes to skip. * @return The number of bytes skipped or <code>-1</code> * if the end of file has been reached and * <code>throwEofException</code> is set to {@code false}. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to {@code true}. * @throws IOException if trying to read past the end of file. */ @Override public long skip(final long numberOfBytes) throws IOException { if (eof) { throw new IOException("Skip after end of file"); } if (position == size) { return doEndOfFile(); } position += numberOfBytes; long returnLength = numberOfBytes; if (position > size) { returnLength = numberOfBytes - (position - size); position = size; } return returnLength; }
/** * Read a byte. * * @return Either The byte value returned by <code>processByte()</code> * or <code>-1</code> if the end of file has been reached and * <code>throwEofException</code> is set to {@code false}. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to {@code true}. * @throws IOException if trying to read past the end of file. */ @Override public int read() throws IOException { if (eof) { throw new IOException("Read after end of file"); } if (position == size) { return doEndOfFile(); } position++; return processByte(); }
/** * Skip a specified number of bytes. * * @param numberOfBytes The number of bytes to skip. * @return The number of bytes skipped or <code>-1</code> * if the end of file has been reached and * <code>throwEofException</code> is set to <code>false</code>. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to <code>true</code>. * @throws IOException if trying to read past the end of file. */ public long skip(long numberOfBytes) throws IOException { if (eof) { throw new IOException("Skip after end of file"); } if (position == size) { return doEndOfFile(); } position += numberOfBytes; long returnLength = numberOfBytes; if (position > size) { returnLength = numberOfBytes - (position - size); position = size; } return returnLength; }
/** * Read the specified number bytes into an array. * * @param bytes The byte array to read into. * @param offset The offset to start reading bytes into. * @param length The number of bytes to read. * @return The number of bytes read or <code>-1</code> * if the end of file has been reached and * <code>throwEofException</code> is set to {@code false}. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to {@code true}. * @throws IOException if trying to read past the end of file. */ @Override public int read(final byte[] bytes, final int offset, final int length) throws IOException { if (eof) { throw new IOException("Read after end of file"); } if (position == size) { return doEndOfFile(); } position += length; int returnLength = length; if (position > size) { returnLength = length - (int)(position - size); position = size; } processBytes(bytes, offset, returnLength); return returnLength; }
/** * Read a byte. * * @return Either The byte value returned by <code>processByte()</code> * or <code>-1</code> if the end of file has been reached and * <code>throwEofException</code> is set to <code>false</code>. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to <code>true</code>. * @throws IOException if trying to read past the end of file. */ public int read() throws IOException { if (eof) { throw new IOException("Read after end of file"); } if (position == size) { return doEndOfFile(); } position++; return processByte(); }
/** * Read the specified number bytes into an array. * * @param bytes The byte array to read into. * @param offset The offset to start reading bytes into. * @param length The number of bytes to read. * @return The number of bytes read or <code>-1</code> * if the end of file has been reached and * <code>throwEofException</code> is set to <code>false</code>. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to <code>true</code>. * @throws IOException if trying to read past the end of file. */ public int read(byte[] bytes, int offset, int length) throws IOException { if (eof) { throw new IOException("Read after end of file"); } if (position == size) { return doEndOfFile(); } position += length; int returnLength = length; if (position > size) { returnLength = length - (int)(position - size); position = size; } processBytes(bytes, offset, returnLength); return returnLength; }
/** * Skip a specified number of bytes. * * @param numberOfBytes The number of bytes to skip. * @return The number of bytes skipped or <code>-1</code> * if the end of file has been reached and * <code>throwEofException</code> is set to <code>false</code>. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to <code>true</code>. * @throws IOException if trying to read past the end of file. */ public long skip(long numberOfBytes) throws IOException { if (eof) { throw new IOException("Skip after end of file"); } if (position == size) { return doEndOfFile(); } position += numberOfBytes; long returnLength = numberOfBytes; if (position > size) { returnLength = numberOfBytes - (position - size); position = size; } return returnLength; }
/** * Skip a specified number of bytes. * * @param numberOfBytes The number of bytes to skip. * @return The number of bytes skipped or <code>-1</code> * if the end of file has been reached and * <code>throwEofException</code> is set to <code>false</code>. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to <code>true</code>. * @throws IOException if trying to read past the end of file. */ public long skip(long numberOfBytes) throws IOException { if (eof) { throw new IOException("Skip after end of file"); } if (position == size) { return doEndOfFile(); } position += numberOfBytes; long returnLength = numberOfBytes; if (position > size) { returnLength = numberOfBytes - (position - size); position = size; } return returnLength; }
/** * Skip a specified number of bytes. * * @param numberOfBytes The number of bytes to skip. * @return The number of bytes skipped or <code>-1</code> * if the end of file has been reached and * <code>throwEofException</code> is set to {@code false}. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to {@code true}. * @throws IOException if trying to read past the end of file. */ @Override public long skip(final long numberOfBytes) throws IOException { if (eof) { throw new IOException("Skip after end of file"); } if (position == size) { return doEndOfFile(); } position += numberOfBytes; long returnLength = numberOfBytes; if (position > size) { returnLength = numberOfBytes - (position - size); position = size; } return returnLength; }
/** * Skip a specified number of bytes. * * @param numberOfBytes The number of bytes to skip. * @return The number of bytes skipped or <code>-1</code> * if the end of file has been reached and * <code>throwEofException</code> is set to <code>false</code>. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to <code>true</code>. * @throws IOException if trying to read past the end of file. */ @Override public long skip(long numberOfBytes) throws IOException { if (eof) { throw new IOException("Skip after end of file"); } if (position == size) { return doEndOfFile(); } position += numberOfBytes; long returnLength = numberOfBytes; if (position > size) { returnLength = numberOfBytes - (position - size); position = size; } return returnLength; }
/** * Skip a specified number of bytes. * * @param numberOfBytes The number of bytes to skip. * @return The number of bytes skipped or <code>-1</code> * if the end of file has been reached and * <code>throwEofException</code> is set to {@code false}. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to {@code true}. * @throws IOException if trying to read past the end of file. */ @Override public long skip(long numberOfBytes) throws IOException { if (eof) { throw new IOException("Skip after end of file"); } if (position == size) { return doEndOfFile(); } position += numberOfBytes; long returnLength = numberOfBytes; if (position > size) { returnLength = numberOfBytes - (position - size); position = size; } return returnLength; }
/** * Skip a specified number of bytes. * * @param numberOfBytes The number of bytes to skip. * @return The number of bytes skipped or <code>-1</code> * if the end of file has been reached and * <code>throwEofException</code> is set to {@code false}. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to {@code true}. * @throws IOException if trying to read past the end of file. */ @Override public long skip(final long numberOfBytes) throws IOException { if (eof) { throw new IOException("Skip after end of file"); } if (position == size) { return doEndOfFile(); } position += numberOfBytes; long returnLength = numberOfBytes; if (position > size) { returnLength = numberOfBytes - (position - size); position = size; } return returnLength; }
/** * Read a byte. * * @return Either The byte value returned by <code>processByte()</code> * or <code>-1</code> if the end of file has been reached and * <code>throwEofException</code> is set to <code>false</code>. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to <code>true</code>. * @throws IOException if trying to read past the end of file. */ public int read() throws IOException { if (eof) { throw new IOException("Read after end of file"); } if (position == size) { return doEndOfFile(); } position++; return processByte(); }
/** * Read a byte. * * @return Either The byte value returned by <code>processByte()</code> * or <code>-1</code> if the end of file has been reached and * <code>throwEofException</code> is set to {@code false}. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to {@code true}. * @throws IOException if trying to read past the end of file. */ @Override public int read() throws IOException { if (eof) { throw new IOException("Read after end of file"); } if (position == size) { return doEndOfFile(); } position++; return processByte(); }
/** * Read a byte. * * @return Either The byte value returned by <code>processByte()</code> * or <code>-1</code> if the end of file has been reached and * <code>throwEofException</code> is set to <code>false</code>. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to <code>true</code>. * @throws IOException if trying to read past the end of file. */ public int read() throws IOException { if (eof) { throw new IOException("Read after end of file"); } if (position == size) { return doEndOfFile(); } position++; return processByte(); }
/** * Read a byte. * * @return Either The byte value returned by <code>processByte()</code> * or <code>-1</code> if the end of file has been reached and * <code>throwEofException</code> is set to {@code false}. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to {@code true}. * @throws IOException if trying to read past the end of file. */ @Override public int read() throws IOException { if (eof) { throw new IOException("Read after end of file"); } if (position == size) { return doEndOfFile(); } position++; return processByte(); }
/** * Read a byte. * * @return Either The byte value returned by <code>processByte()</code> * or <code>-1</code> if the end of file has been reached and * <code>throwEofException</code> is set to {@code false}. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to {@code true}. * @throws IOException if trying to read past the end of file. */ @Override public int read() throws IOException { if (eof) { throw new IOException("Read after end of file"); } if (position == size) { return doEndOfFile(); } position++; return processByte(); }
/** * Read a byte. * * @return Either The byte value returned by <code>processByte()</code> * or <code>-1</code> if the end of file has been reached and * <code>throwEofException</code> is set to <code>false</code>. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to <code>true</code>. * @throws IOException if trying to read past the end of file. */ @Override public int read() throws IOException { if (eof) { throw new IOException("Read after end of file"); } if (position == size) { return doEndOfFile(); } position++; return processByte(); }
/** * Read the specified number bytes into an array. * * @param bytes The byte array to read into. * @param offset The offset to start reading bytes into. * @param length The number of bytes to read. * @return The number of bytes read or <code>-1</code> * if the end of file has been reached and * <code>throwEofException</code> is set to <code>false</code>. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to <code>true</code>. * @throws IOException if trying to read past the end of file. */ public int read(byte[] bytes, int offset, int length) throws IOException { if (eof) { throw new IOException("Read after end of file"); } if (position == size) { return doEndOfFile(); } position += length; int returnLength = length; if (position > size) { returnLength = length - (int)(position - size); position = size; } processBytes(bytes, offset, returnLength); return returnLength; }
/** * Read the specified number bytes into an array. * * @param bytes The byte array to read into. * @param offset The offset to start reading bytes into. * @param length The number of bytes to read. * @return The number of bytes read or <code>-1</code> * if the end of file has been reached and * <code>throwEofException</code> is set to {@code false}. * @throws EOFException if the end of file is reached and * <code>throwEofException</code> is set to {@code true}. * @throws IOException if trying to read past the end of file. */ @Override public int read(byte[] bytes, int offset, int length) throws IOException { if (eof) { throw new IOException("Read after end of file"); } if (position == size) { return doEndOfFile(); } position += length; int returnLength = length; if (position > size) { returnLength = length - (int)(position - size); position = size; } processBytes(bytes, offset, returnLength); return returnLength; }