Class ProxyCollectionWriter

java.lang.Object
java.io.Writer
org.apache.commons.io.output.FilterCollectionWriter
org.apache.commons.io.output.ProxyCollectionWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
Direct Known Subclasses:
TeeWriter

public class ProxyCollectionWriter extends FilterCollectionWriter
A Proxy stream collection which acts as expected, that is it passes the method calls on to the proxied streams and doesn't change which methods are being called. It is an alternative base class to FilterWriter and FilterCollectionWriter to increase reusability, because FilterWriter changes the methods being called, such as write(char[]) to write(char[], int, int) and write(String) to write(String, int, int). This is in contrast to ProxyWriter which is backed by a single Writer.
Since:
2.7
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new proxy collection writer.
    Constructs a new proxy collection writer.
  • Method Summary

    Modifier and Type
    Method
    Description
    append(char c)
    Invokes the delegates' append(char) methods.
    Invokes the delegates' append(CharSequence) methods.
    append(CharSequence csq, int start, int end)
    Invokes the delegates' append(CharSequence, int, int) methods.
    void
    Invokes the delegate's close() method.
    void
    Invokes the delegate's flush() method.
    void
    write(char[] cbuf)
    Invokes the delegate's write(char[]) method.
    void
    write(char[] cbuf, int off, int len)
    Invokes the delegate's write(char[], int, int) method.
    void
    write(int c)
    Invokes the delegate's write(int) method.
    void
    Invokes the delegate's write(String) method.
    void
    write(String str, int off, int len)
    Invokes the delegate's write(String) method.

    Methods inherited from class java.io.Writer

    nullWriter

    Methods inherited from class java.lang.Object

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

    • ProxyCollectionWriter

      public ProxyCollectionWriter(Collection<Writer> writers)
      Constructs a new proxy collection writer.
      Parameters:
      writers - Writers object to provide the underlying targets.
    • ProxyCollectionWriter

      public ProxyCollectionWriter(Writer... writers)
      Constructs a new proxy collection writer.
      Parameters:
      writers - Writers to provide the underlying targets.
  • Method Details