Class DbgTimer.TabbingOutputStream

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

    public static class DbgTimer.TabbingOutputStream
    extends java.io.OutputStream
    A (rather slow) output stream that indents every line of its output
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.io.OutputStream out  
      protected int state  
      protected static int STATE_LINE  
      protected static int STATE_NOLINE  
      protected java.util.Stack<java.lang.Long> timeStack  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void flush()  
      protected void setTimeStack​(java.util.Stack<java.lang.Long> timeStack)
      Workaround: Set the time stack reference
      protected void startln()
      Start a new (indented) line of output
      void write​(int b)
      Parses each line and prepends the indentation as they are printed
      • Methods inherited from class java.io.OutputStream

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

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

      • out

        protected java.io.OutputStream out
      • state

        protected int state
      • timeStack

        protected java.util.Stack<java.lang.Long> timeStack
    • Method Detail

      • startln

        protected void startln()
                        throws java.io.IOException
        Start a new (indented) line of output
        Throws:
        java.io.IOException
      • setTimeStack

        protected void setTimeStack​(java.util.Stack<java.lang.Long> timeStack)
        Workaround: Set the time stack reference
        Parameters:
        timeStack - the stack
      • write

        public void write​(int b)
                   throws java.io.IOException
        Parses each line and prepends the indentation as they are printed
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • 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
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.OutputStream
        Throws:
        java.io.IOException