Class DualOutputStream

All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class DualOutputStream extends FilterOutputStream
This FilterOutputStream subclass directs its output to both its primary and alternate contained streams.
Author:
Andrew Pavlin, KA2DDO
  • Field Summary

    Fields inherited from class java.io.FilterOutputStream

    out
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an output stream filter built on top of the specified two underlying output streams.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this output stream and releases any system resources associated with the stream.
    void
    Flushes this output stream and forces any buffered output bytes to be written out to the stream.
    void
    write(byte[] b)
    Writes b.length bytes to this output stream.
    void
    write(byte[] b, int off, int len)
    Writes len bytes from the specified byte array starting at offset off to this output stream.
    void
    write(int b)
    Writes the specified byte to this output stream.

    Methods inherited from class java.io.OutputStream

    nullOutputStream

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DualOutputStream

      public DualOutputStream(OutputStream out1, OutputStream out2)
      Creates an output stream filter built on top of the specified two underlying output streams.
      Parameters:
      out1 - the underlying output stream to be assigned to the field this.out for later use, or null if this instance is to be created without an underlying stream.
      out2 - the second output stream which should get a copy of all bytes written to this stream.
  • Method Details