@Override public final byte readByte() throws IOException { if (bufferPosition >= currentBufferSize) { nextChunk(); bufferPosition = 0; } return buffer[bufferPosition++]; }
@Override public final byte readByte() throws IOException { if (bufferPosition >= currentBufferSize) { nextChunk(); bufferPosition = 0; } return buffer[bufferPosition++]; }
@Override public final byte readByte() throws IOException { if (bufferPosition >= currentBufferSize) { nextChunk(); bufferPosition = 0; } return buffer[bufferPosition++]; }
@Override public final void readBytes(final byte[] b, int offset, int bytesToRead) throws IOException { if (buffer == null) { nextChunk(); } while (bytesToRead > 0) { int bytesToCopy = Math.min(currentBufferSize - bufferPosition, bytesToRead); System.arraycopy(buffer, bufferPosition, b, offset, bytesToCopy); offset += bytesToCopy; bytesToRead -= bytesToCopy; bufferPosition += bytesToCopy; if (bufferPosition >= currentBufferSize && bytesToRead > 0) { nextChunk(); bufferPosition = 0; } } }
@Override public final void readBytes(final byte[] b, int offset, int bytesToRead) throws IOException { if (buffer == null) { nextChunk(); } while (bytesToRead > 0) { int bytesToCopy = Math.min(currentBufferSize - bufferPosition, bytesToRead); System.arraycopy(buffer, bufferPosition, b, offset, bytesToCopy); offset += bytesToCopy; bytesToRead -= bytesToCopy; bufferPosition += bytesToCopy; if (bufferPosition >= currentBufferSize && bytesToRead > 0) { nextChunk(); bufferPosition = 0; } } }
@Override public final void readBytes(final byte[] b, int offset, int bytesToRead) throws IOException { if (buffer == null) { nextChunk(); } while (bytesToRead > 0) { int bytesToCopy = Math.min(currentBufferSize - bufferPosition, bytesToRead); System.arraycopy(buffer, bufferPosition, b, offset, bytesToCopy); offset += bytesToCopy; bytesToRead -= bytesToCopy; bufferPosition += bytesToCopy; if (bufferPosition >= currentBufferSize && bytesToRead > 0) { nextChunk(); bufferPosition = 0; } } }