@Test public void testMarkSupported() throws IOException { InputStream inputStream = mock(InputStream.class); when(inputStream.markSupported()).thenReturn(true); SnifferInputStream sis = new SnifferInputStream(snifferSocket, inputStream); assertEquals(true, sis.markSupported()); verify(snifferSocket).logSocket(anyLong()); }
@Override public boolean markSupported() { long start = System.currentTimeMillis(); try { return delegate.markSupported(); } finally { snifferSocket.logSocket(System.currentTimeMillis() - start); } }
SnifferInputStream extends InputStream { @Override public boolean markSupported() { long start = System.currentTimeMillis(); try { return delegate.markSupported(); } finally { snifferSocket.logSocket(System.currentTimeMillis() - start); } } }
SnifferInputStream extends InputStream { @Override public boolean markSupported() { long start = System.currentTimeMillis(); try { return delegate.markSupported(); } finally { snifferSocket.logSocket(System.currentTimeMillis() - start); } } SnifferInputStream(SnifferSocketImpl snifferSocket, InputStream delegate); }
SnifferInputStream extends InputStream { @Override public boolean markSupported() { long start = System.currentTimeMillis(); try { return delegate.markSupported(); } finally { snifferSocket.logSocket(System.currentTimeMillis() - start); } } SnifferInputStream(SnifferSocketImpl snifferSocket, InputStream delegate); @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 void mark(int readlimit); @Override void reset(); @Override boolean markSupported(); }
SnifferInputStream extends InputStream { @Override public boolean markSupported() { long start = System.currentTimeMillis(); try { return delegate.markSupported(); } finally { snifferSocket.logSocket(System.currentTimeMillis() - start); } } SnifferInputStream(SnifferSocketImpl snifferSocket, InputStream delegate); @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 void mark(int readlimit); @Override void reset(); @Override boolean markSupported();  }