@Override public int read() throws IOException { if (available() == 0) { return -1; } return buffer.readByte() & 0xff; }
@Override public void readBytes(byte[] b, int offset, int len) throws IOException { int read = read(b, offset, len); if (read < len) { throw new IndexOutOfBoundsException(); } }
@Override public StreamInput streamInput() { return new ByteBufStreamInput(buffer.duplicate(), length); }
@Override public StreamInput streamInput() { return new ByteBufStreamInput(buffer.duplicate(), length); }
@Override public int read() throws IOException { if (available() == 0) { return -1; } return buffer.readByte() & 0xff; }
@Override public StreamInput streamInput() { return new ByteBufStreamInput(buffer.duplicate(), length); }
@Override public void readBytes(byte[] b, int offset, int len) throws IOException { int read = read(b, offset, len); if (read < len) { throw new IndexOutOfBoundsException(); } }
@Override public int read() throws IOException { if (available() == 0) { return -1; } return buffer.readByte() & 0xff; }
@Override public StreamInput streamInput() { return new ByteBufStreamInput(buffer.duplicate(), length); }
@Override public void readBytes(byte[] b, int offset, int len) throws IOException { int read = read(b, offset, len); if (read < len) { throw new IndexOutOfBoundsException(); } }
@Override public int read() throws IOException { if (available() == 0) { return -1; } return buffer.readByte() & 0xff; }
private StreamInput in(final Byte status, final ByteBuf slice, final int remaining) throws IOException { final ByteBufStreamInput in = new ByteBufStreamInput(slice, remaining); if (TransportStatus.isCompress(status)) { final Compressor compressor = CompressorFactory.compressor(Netty4Utils.toBytesReference(slice)); return compressor.streamInput(in); } else { return in; } }
@Override public void readBytes(byte[] b, int offset, int len) throws IOException { int read = read(b, offset, len); if (read < len) { throw new IndexOutOfBoundsException(); } }
public int skipBytes(int n) throws IOException { int nBytes = Math.min(available(), n); buffer.skipBytes(nBytes); return nBytes; }
public int skipBytes(int n) throws IOException { int nBytes = Math.min(available(), n); buffer.skipBytes(nBytes); return nBytes; }
public int skipBytes(int n) throws IOException { int nBytes = Math.min(available(), n); buffer.skipBytes(nBytes); return nBytes; }