@Test public void testReset() throws IOException { InputStream is = new ExtensibleBufferedInputStream() { boolean returned = false; @Override protected ByteBuffer nextBuffer() throws IOException { if (returned) { return null; } ByteBuffer result = ByteBuffer.allocate(3); returned = true; return result; } }; is.read(); is.read(); is.reset(); for (int i = 0; i < 3; i++) { assertEquals(0, is.read()); } assertEquals(-1, is.read()); }
@Override public void reset() throws IOException { if (buf != null) { buf.rewind(); } }
ExtensibleBufferedInputStream extends InputStream { @Override public void reset() throws IOException { if (buf != null) { buf.rewind(); } } }
ExtensibleBufferedInputStream extends InputStream { @Override public void reset() throws IOException { if (buf != null) { buf.rewind(); } }  }
ExtensibleBufferedInputStream extends InputStream { @Override public void reset() throws IOException { if (buf != null) { buf.rewind(); } }  @Override int read(); @Override int read(byte[] b, int off, int len); @Override void reset(); ByteBuffer getBuffer(); }
ExtensibleBufferedInputStream extends InputStream { @Override public void reset() throws IOException { if (buf != null) { buf.rewind(); } }  @Override int read(); @Override int read(byte[] b, int off, int len); @Override void reset(); ByteBuffer getBuffer();  }