Package jade.util

Class PrintStreamSplitter

  • All Implemented Interfaces:
    Closeable, Flushable, Appendable, AutoCloseable

    public class PrintStreamSplitter
    extends PrintStream
    This class is an OutputStream whose output is duplicated and forwarded to two different output streams.
    Author:
    Giovanni Caire - TILab
    • Constructor Detail

      • PrintStreamSplitter

        public PrintStreamSplitter​(PrintStream s1,
                                   PrintStream s2)
                            throws IOException
        Create a new stream that feeds the output to the two given streams.
        Parameters:
        s1 - The first stream to write to.
        s2 - The second stream to write to.
        Throws:
        IOException - If some stream operation fails.
    • Method Detail

      • print

        public void print​(Object obj)
        Print a Java object to the two streams.
        Overrides:
        print in class PrintStream
        Parameters:
        obj - The Java object to print.
      • print

        public void print​(String str)
        Print a string to the two streams.
        Overrides:
        print in class PrintStream
        Parameters:
        str - The string to print.
      • println

        public void println()
        Print a new line to the two streams.
        Overrides:
        println in class PrintStream
      • println

        public void println​(Object obj)
        Print a Java object and a new line to the two streams.
        Overrides:
        println in class PrintStream
        Parameters:
        obj - The Java object to print.
      • println

        public void println​(String str)
        Print a string and a new line to the two streams.
        Overrides:
        println in class PrintStream
        Parameters:
        str - The string to print.