@Test public void mark() throws Exception { when(istream.skip(17)).thenReturn(17L); ByteCountingInputStream s = new ByteCountingInputStream(istream); s.skip(17); s.mark(2000); s.skip(17); assertEquals(2 * 17, s.getBytesRead()); s.reset(); assertEquals(17, s.getBytesRead()); verify(istream, times(2)).skip(17); verify(istream, times(1)).mark(2000); verify(istream, times(1)).reset(); verifyNoMoreInteractions(istream); }
@Override public synchronized void mark(int readlimit) { in_.mark(readlimit); reset_len_ = len_; }
ByteCountingInputStream extends InputStream { @Override public synchronized void mark(int readlimit) { in_.mark(readlimit); reset_len_ = len_; } }
ByteCountingInputStream extends InputStream { @Override public synchronized void mark(int readlimit) { in_.mark(readlimit); reset_len_ = len_; } ByteCountingInputStream(InputStream in, boolean propagate_close);  ByteCountingInputStream(InputStream in); }
ByteCountingInputStream extends InputStream { @Override public synchronized void mark(int readlimit) { in_.mark(readlimit); reset_len_ = len_; } ByteCountingInputStream(InputStream in, boolean propagate_close);  ByteCountingInputStream(InputStream in); long getBytesRead(); @Override int read(); @Override int read(byte b[]); @Override int read(byte b[], int off, int len); @Override long skip(long n); @Override int available(); @Override void close(); @Override synchronized void mark(int readlimit); @Override synchronized void reset(); @Override boolean markSupported(); }
ByteCountingInputStream extends InputStream { @Override public synchronized void mark(int readlimit) { in_.mark(readlimit); reset_len_ = len_; } ByteCountingInputStream(InputStream in, boolean propagate_close);  ByteCountingInputStream(InputStream in); long getBytesRead(); @Override int read(); @Override int read(byte b[]); @Override int read(byte b[], int off, int len); @Override long skip(long n); @Override int available(); @Override void close(); @Override synchronized void mark(int readlimit); @Override synchronized void reset(); @Override boolean markSupported();  }