@Test public void testSkip() throws IOException { ByteBuf buf = Unpooled.buffer(12); buf.writeInt(12); buf.writeInt(23); buf.writeInt(34); DynamicCompositeByteBuf compositeByteBuf = new DynamicCompositeByteBuf(buf); DynamicCompositeByteBufInputStream inputStream = new DynamicCompositeByteBufInputStream(compositeByteBuf); inputStream.skip(4); int i = inputStream.readInt(); Assert.assertTrue(i == 23); compositeByteBuf.release(); inputStream.close(); }
@Override public long skip(long n) throws IOException { if (n > Integer.MAX_VALUE) { return skipBytes(Integer.MAX_VALUE); } else { return skipBytes((int) n); } }
DynamicCompositeByteBufInputStream extends InputStream implements DataInput { @Override public long skip(long n) throws IOException { if (n > Integer.MAX_VALUE) { return skipBytes(Integer.MAX_VALUE); } else { return skipBytes((int) n); } } }
DynamicCompositeByteBufInputStream extends InputStream implements DataInput { @Override public long skip(long n) throws IOException { if (n > Integer.MAX_VALUE) { return skipBytes(Integer.MAX_VALUE); } else { return skipBytes((int) n); } } DynamicCompositeByteBufInputStream(DynamicCompositeByteBuf compositeByteBuf);  DynamicCompositeByteBufInputStream(DynamicCompositeByteBuf buffer, boolean releaseOnClose); }
DynamicCompositeByteBufInputStream extends InputStream implements DataInput { @Override public long skip(long n) throws IOException { if (n > Integer.MAX_VALUE) { return skipBytes(Integer.MAX_VALUE); } else { return skipBytes((int) n); } } DynamicCompositeByteBufInputStream(DynamicCompositeByteBuf compositeByteBuf);  DynamicCompositeByteBufInputStream(DynamicCompositeByteBuf buffer, boolean releaseOnClose); @Override void close(); @Override int available(); @Override boolean markSupported(); @Override int read(); @Override int read(byte[] b, int off, int len); @Override long skip(long n); int skipBytes(int n); @Override boolean readBoolean(); @Override byte readByte(); @Override char readChar(); @Override double readDouble(); @Override float readFloat(); @Override void readFully(byte[] b); @Override void readFully(byte[] b, int off, int len); @Override int readInt(); @Override String readLine(); @Override long readLong(); @Override short readShort(); @Override String readUTF(); @Override int readUnsignedByte(); @Override int readUnsignedShort(); }
DynamicCompositeByteBufInputStream extends InputStream implements DataInput { @Override public long skip(long n) throws IOException { if (n > Integer.MAX_VALUE) { return skipBytes(Integer.MAX_VALUE); } else { return skipBytes((int) n); } } DynamicCompositeByteBufInputStream(DynamicCompositeByteBuf compositeByteBuf);  DynamicCompositeByteBufInputStream(DynamicCompositeByteBuf buffer, boolean releaseOnClose); @Override void close(); @Override int available(); @Override boolean markSupported(); @Override int read(); @Override int read(byte[] b, int off, int len); @Override long skip(long n); int skipBytes(int n); @Override boolean readBoolean(); @Override byte readByte(); @Override char readChar(); @Override double readDouble(); @Override float readFloat(); @Override void readFully(byte[] b); @Override void readFully(byte[] b, int off, int len); @Override int readInt(); @Override String readLine(); @Override long readLong(); @Override short readShort(); @Override String readUTF(); @Override int readUnsignedByte(); @Override int readUnsignedShort();  }