Class MeteredStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

    public final class MeteredStream
    extends OutputStream
    A metered stream is a subclass of OutputStream that (a) forwards all its output to a target stream (b) keeps track of how many bytes have been written.
    • Constructor Detail

      • MeteredStream

        public MeteredStream​(OutputStream out,
                             long written)
        Create the stream wrapped around the specified output stream.
        Parameters:
        out - The target output stream to keep track of.
        written - The number of bytes written to the stream.