### Question:
CountingFileInputStream extends FileInputStream { @Override public int read () throws IOException { final int ret = super.read (); if (ret != -1) s_aReadSizeHdl.addSize (1L); return ret; } CountingFileInputStream(@Nonnull final File aFile);  CountingFileInputStream(@Nonnull final String sFilename); @Override int read(); @Override int read(final byte [] b); @Override int read(final byte [] b, final int nOffset, final int nLength);  }### Answer:
@Test public void testAll () throws IOException { CountingFileInputStream aCIS = new CountingFileInputStream ("pom.xml"); try { aCIS.read (); assertEquals (1, aCIS.read (new byte [5], 1, 1)); StreamHelper.copyInputStreamToOutputStream (aCIS, new NonBlockingByteArrayOutputStream ()); CommonsTestHelper.testToStringImplementation (aCIS); } finally { StreamHelper.close (aCIS); } aCIS = new CountingFileInputStream (new File ("pom.xml")); try { aCIS.read (); assertEquals (1, aCIS.read (new byte [5], 1, 1)); StreamHelper.copyInputStreamToOutputStream (aCIS, new NonBlockingByteArrayOutputStream ()); CommonsTestHelper.testToStringImplementation (aCIS); } finally { StreamHelper.close (aCIS); } }