Class EchoStream

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

    public class EchoStream
    extends java.io.OutputStream
    Stream duplicates all writes into two streams. Used to write all output into console together with aggregation into separate stream (to be able to inspect output as string).
    Since:
    20.11.2023
    • Constructor Summary

      Constructors 
      Constructor Description
      EchoStream​(java.io.OutputStream out)  
      EchoStream​(java.io.OutputStream out, java.io.OutputStream collector)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String toString()  
      void write​(int i)  
      • Methods inherited from class java.io.OutputStream

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

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

      • EchoStream

        public EchoStream​(java.io.OutputStream out)
      • EchoStream

        public EchoStream​(java.io.OutputStream out,
                          java.io.OutputStream collector)
    • Method Detail

      • write

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object