Package mgui.io.util

Class ParallelOutputStream

java.lang.Object
java.io.OutputStream
mgui.io.util.ParallelOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

public class ParallelOutputStream
extends java.io.OutputStream
Simple class which writes to multiple output streams
Author:
Andrew Reid
  • Constructor Summary

    Constructors
    Constructor Description
    ParallelOutputStream()  
    ParallelOutputStream​(java.util.ArrayList<java.io.OutputStream> streams)  
  • Method Summary

    Modifier and Type Method Description
    void addStream​(java.io.OutputStream stream)  
    void close()  
    void flush()  
    java.util.ArrayList<java.io.OutputStream> getStreams()  
    void removeStream​(java.io.OutputStream stream)  
    void write​(int b)  

    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
  • Constructor Details

    • ParallelOutputStream

      public ParallelOutputStream()
    • ParallelOutputStream

      public ParallelOutputStream​(java.util.ArrayList<java.io.OutputStream> streams)
  • Method Details

    • addStream

      public void addStream​(java.io.OutputStream stream)
    • removeStream

      public void removeStream​(java.io.OutputStream stream)
    • getStreams

      public java.util.ArrayList<java.io.OutputStream> getStreams()
    • write

      public void write​(int b) throws java.io.IOException
      Specified by:
      write 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
    • 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