Class CountingInputStreamForSockets

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.ka2ddo.yaac.io.CountingInputStreamForSockets
All Implemented Interfaces:
Closeable, AutoCloseable

public final class CountingInputStreamForSockets extends FilterInputStream
InputStream to count the number of bytes read from the input, so as to drive a progress bar, but it avoids using the read() method of the passed-in InputStream, as SocketInputStream malloc's a 1-byte byte array for each such read, then throws the array away.
Author:
Andrew Pavlin, KA2DDO
  • Constructor Details

    • CountingInputStreamForSockets

      public CountingInputStreamForSockets(InputStream in)
      Create a CountingInputStream wrapped around the specified InputStream.
      Parameters:
      in - the InputStream to count.
  • Method Details