Package 

Class CountingOutputStream

  • All Implemented Interfaces:
    java.io.Closeable , java.io.Flushable , java.lang.AutoCloseable

    
    public class CountingOutputStream
    extends FilterOutputStream
                        

    An OutputStream that counts the number of bytes written.

    • Constructor Summary

      Constructors 
      Constructor Description
      CountingOutputStream(OutputStream out) Constructs a new {@code FilterOutputStream} with {@code out} as its target stream.
    • Method Summary

      Modifier and Type Method Description
      long getCount() Returns the number of bytes written.
      void write(Array<byte> b, int off, int len)
      void write(int b)
      void close()
      • Methods inherited from class java.io.FilterOutputStream

        close, flush, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CountingOutputStream

        CountingOutputStream(OutputStream out)
        Constructs a new {@code FilterOutputStream} with {@code out} as its target stream.
        Parameters:
        out - the target stream that this stream writes to.
    • Method Detail

      • getCount

         long getCount()

        Returns the number of bytes written.

      • write

         void write(Array<byte> b, int off, int len)
      • write

         void write(int b)