Class RollingFileStream.MeteredStream

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

    private class RollingFileStream.MeteredStream
    extends java.io.OutputStream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.io.OutputStream out
      The real OutputStream to delegate to
      (package private) int written
      The number of bytes written so far to the OutputStream
    • Constructor Summary

      Constructors 
      Constructor Description
      MeteredStream​(java.io.OutputStream out, int written)
      Creates a new instance of MeteredStream
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      int getWritten()  
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

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

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

      • out

        java.io.OutputStream out
        The real OutputStream to delegate to
      • written

        int written
        The number of bytes written so far to the OutputStream
    • Constructor Detail

      • MeteredStream

        MeteredStream​(java.io.OutputStream out,
                      int written)
        Creates a new instance of MeteredStream
        Parameters:
        out - The OutputStream to delegate to
        written - The number of bytes currently written to the OuptutStream
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • getWritten

        public int getWritten()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
        Throws:
        java.io.IOException