? ProxyWriter

java.lang.Object
java.io.Writer
java.io.FilterWriter
org.apache.commons.io.output.ProxyWriter
????????:
Closeable, Flushable, Appendable, AutoCloseable
??????:
CloseShieldWriter, TaggedWriter

public class ProxyWriter extends FilterWriter
A Proxy stream which acts as expected, that is it passes the method calls on to the proxied stream and doesn't change which methods are being called. It is an alternative base class to FilterWriter 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).
  • ???????

    • ProxyWriter

      public ProxyWriter(Writer proxy)
      Constructs a new ProxyWriter.
      ??:
      proxy - the Writer to delegate to
  • ??????

    • append

      public Writer append(char c) throws IOException
      Invokes the delegate's append(char) method.
      ???:
      append ???? Appendable
      ??:
      append ??? Writer
      ??:
      c - The character to write
      ??:
      this writer
      ??:
      IOException - if an I/O error occurs.
      ???????:
      2.0
    • append

      public Writer append(CharSequence csq, int start, int end) throws IOException
      Invokes the delegate's append(CharSequence, int, int) method.
      ???:
      append ???? Appendable
      ??:
      append ??? Writer
      ??:
      csq - The character sequence to write
      start - The index of the first character to write
      end - The index of the first character to write (exclusive)
      ??:
      this writer
      ??:
      IOException - if an I/O error occurs.
      ???????:
      2.0
    • append

      public Writer append(CharSequence csq) throws IOException
      Invokes the delegate's append(CharSequence) method.
      ???:
      append ???? Appendable
      ??:
      append ??? Writer
      ??:
      csq - The character sequence to write
      ??:
      this writer
      ??:
      IOException - if an I/O error occurs.
      ???????:
      2.0
    • write

      public void write(int c) throws IOException
      Invokes the delegate's write(int) method.
      ??:
      write ??? FilterWriter
      ??:
      c - the character to write
      ??:
      IOException - if an I/O error occurs.
    • write

      public void write(char[] cbuf) throws IOException
      Invokes the delegate's write(char[]) method.
      ??:
      write ??? Writer
      ??:
      cbuf - the characters to write
      ??:
      IOException - if an I/O error occurs.
    • write

      public void write(char[] cbuf, int off, int len) throws IOException
      Invokes the delegate's write(char[], int, int) method.
      ??:
      write ??? FilterWriter
      ??:
      cbuf - the characters to write
      off - The start offset
      len - The number of characters to write
      ??:
      IOException - if an I/O error occurs.
    • write

      public void write(String str) throws IOException
      Invokes the delegate's write(String) method.
      ??:
      write ??? Writer
      ??:
      str - the string to write
      ??:
      IOException - if an I/O error occurs.
    • write

      public void write(String str, int off, int len) throws IOException
      Invokes the delegate's write(String) method.
      ??:
      write ??? FilterWriter
      ??:
      str - the string to write
      off - The start offset
      len - The number of characters to write
      ??:
      IOException - if an I/O error occurs.
    • flush

      public void flush() throws IOException
      Invokes the delegate's flush() method.
      ???:
      flush ???? Flushable
      ??:
      flush ??? FilterWriter
      ??:
      IOException - if an I/O error occurs.
    • close

      public void close() throws IOException
      Invokes the delegate's close() method.
      ???:
      close ???? AutoCloseable
      ???:
      close ???? Closeable
      ??:
      close ??? FilterWriter
      ??:
      IOException - if an I/O error occurs.
    • beforeWrite

      protected void beforeWrite(int n) throws IOException
      Invoked by the write methods before the call is proxied. The number of chars to be written (1 for the write(int) method, buffer length for write(char[]), etc.) is given as an argument.

      Subclasses can override this method to add common pre-processing functionality without having to override all the write methods. The default implementation does nothing.

      ??:
      n - number of chars to be written
      ??:
      IOException - if the pre-processing fails
      ???????:
      2.0
    • afterWrite

      protected void afterWrite(int n) throws IOException
      Invoked by the write methods after the proxied call has returned successfully. The number of chars written (1 for the write(int) method, buffer length for write(char[]), etc.) is given as an argument.

      Subclasses can override this method to add common post-processing functionality without having to override all the write methods. The default implementation does nothing.

      ??:
      n - number of chars written
      ??:
      IOException - if the post-processing fails
      ???????:
      2.0
    • handleIOException

      protected void handleIOException(IOException e) throws IOException
      Handle any IOExceptions thrown.

      This method provides a point to implement custom exception handling. The default behavior is to re-throw the exception.

      ??:
      e - The IOException thrown
      ??:
      IOException - if an I/O error occurs.
      ???????:
      2.0