@Override public long readLong() { ensureAvailable(SIZE_OF_LONG); long v = slice.getLongUnchecked(bufferPosition); bufferPosition += SIZE_OF_LONG; return v; }
@Override public byte readByte() { ensureAvailable(SIZE_OF_BYTE); byte v = slice.getByteUnchecked(bufferPosition); bufferPosition += SIZE_OF_BYTE; return v; }
@Override public long readLong() { ensureAvailable(SIZE_OF_LONG); long v = slice.getLongUnchecked(bufferPosition); bufferPosition += SIZE_OF_LONG; return v; }
@Override public void readBytes(OutputStream out, int length) throws IOException { while (length > 0) { int batch = Math.min(availableBytes(), length); out.write(buffer, bufferPosition, batch); bufferPosition += batch; length -= batch; ensureAvailable(Math.min(length, MINIMUM_CHUNK_SIZE)); } }
@Override public byte readByte() { ensureAvailable(SIZE_OF_BYTE); byte v = slice.getByteUnchecked(bufferPosition); bufferPosition += SIZE_OF_BYTE; return v; }
@Override public short readShort() { ensureAvailable(SIZE_OF_SHORT); short v = slice.getShortUnchecked(bufferPosition); bufferPosition += SIZE_OF_SHORT; return v; }
@Override public int readInt() { ensureAvailable(SIZE_OF_INT); int v = slice.getIntUnchecked(bufferPosition); bufferPosition += SIZE_OF_INT; return v; }
@Override public short readShort() { ensureAvailable(SIZE_OF_SHORT); short v = slice.getShortUnchecked(bufferPosition); bufferPosition += SIZE_OF_SHORT; return v; }
@Override public int readInt() { ensureAvailable(SIZE_OF_INT); int v = slice.getIntUnchecked(bufferPosition); bufferPosition += SIZE_OF_INT; return v; }
@Override public void readBytes(OutputStream out, int length) throws IOException { while (length > 0) { int batch = Math.min(availableBytes(), length); out.write(buffer, bufferPosition, batch); bufferPosition += batch; length -= batch; ensureAvailable(Math.min(length, MINIMUM_CHUNK_SIZE)); } }
@Override public void readBytes(Slice destination, int destinationIndex, int length) { while (length > 0) { int batch = Math.min(availableBytes(), length); slice.getBytes(bufferPosition, destination, destinationIndex, batch); bufferPosition += batch; destinationIndex += batch; length -= batch; ensureAvailable(Math.min(length, MINIMUM_CHUNK_SIZE)); } }
@Override public void readBytes(byte[] destination, int destinationIndex, int length) { while (length > 0) { int batch = Math.min(availableBytes(), length); slice.getBytes(bufferPosition, destination, destinationIndex, batch); bufferPosition += batch; destinationIndex += batch; length -= batch; ensureAvailable(Math.min(length, MINIMUM_CHUNK_SIZE)); } }
@Override public void readBytes(Slice destination, int destinationIndex, int length) { while (length > 0) { int batch = Math.min(availableBytes(), length); slice.getBytes(bufferPosition, destination, destinationIndex, batch); bufferPosition += batch; destinationIndex += batch; length -= batch; ensureAvailable(Math.min(length, MINIMUM_CHUNK_SIZE)); } }
@Override public void readBytes(byte[] destination, int destinationIndex, int length) { while (length > 0) { int batch = Math.min(availableBytes(), length); slice.getBytes(bufferPosition, destination, destinationIndex, batch); bufferPosition += batch; destinationIndex += batch; length -= batch; ensureAvailable(Math.min(length, MINIMUM_CHUNK_SIZE)); } }