public class ProxyWriter
extends java.io.FilterWriter
write(char[]) to write(char[], int, int)
and write(String) to write(String, int, int).| Constructor and Description |
|---|
ProxyWriter(java.io.Writer proxy)
Constructs a new ProxyWriter.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterWrite(int n)
Invoked by the write methods after the proxied call has returned
successfully.
|
java.io.Writer |
append(char c)
Invokes the delegate's
append(char) method. |
java.io.Writer |
append(java.lang.CharSequence csq)
Invokes the delegate's
append(CharSequence) method. |
java.io.Writer |
append(java.lang.CharSequence csq,
int start,
int end)
Invokes the delegate's
append(CharSequence, int, int) method. |
protected void |
beforeWrite(int n)
Invoked by the write methods before the call is proxied.
|
void |
close()
Invokes the delegate's
close() method. |
void |
flush()
Invokes the delegate's
flush() method. |
protected void |
handleIOException(java.io.IOException e)
Handles any IOExceptions thrown.
|
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 |
write(java.lang.String str)
Invokes the delegate's
write(String) method. |
void |
write(java.lang.String str,
int off,
int len)
Invokes the delegate's
write(String) method. |
public ProxyWriter(java.io.Writer proxy)
proxy - the Writer to delegate toprotected void afterWrite(int n)
throws java.io.IOException
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 writtenjava.io.IOException - if the post-processing failspublic java.io.Writer append(char c)
throws java.io.IOException
append(char) method.append in interface java.lang.Appendableappend in class java.io.Writerc - The character to writejava.io.IOException - if an I/O error occurs.public java.io.Writer append(java.lang.CharSequence csq)
throws java.io.IOException
append(CharSequence) method.append in interface java.lang.Appendableappend in class java.io.Writercsq - The character sequence to writejava.io.IOException - if an I/O error occurs.public java.io.Writer append(java.lang.CharSequence csq,
int start,
int end)
throws java.io.IOException
append(CharSequence, int, int) method.append in interface java.lang.Appendableappend in class java.io.Writercsq - The character sequence to writestart - The index of the first character to writeend - The index of the first character to write (exclusive)java.io.IOException - if an I/O error occurs.protected void beforeWrite(int n)
throws java.io.IOException
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 writtenjava.io.IOException - if the pre-processing failspublic void close()
throws java.io.IOException
close() method.close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.FilterWriterjava.io.IOException - if an I/O error occurs.public void flush()
throws java.io.IOException
flush() method.flush in interface java.io.Flushableflush in class java.io.FilterWriterjava.io.IOException - if an I/O error occurs.protected void handleIOException(java.io.IOException e)
throws java.io.IOException
This method provides a point to implement custom exception handling. The default behavior is to re-throw the exception.
e - The IOException thrownjava.io.IOException - if an I/O error occurs.public void write(char[] cbuf)
throws java.io.IOException
write(char[]) method.write in class java.io.Writercbuf - the characters to writejava.io.IOException - if an I/O error occurs.public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write(char[], int, int) method.write in class java.io.FilterWritercbuf - the characters to writeoff - The start offsetlen - The number of characters to writejava.io.IOException - if an I/O error occurs.public void write(int c)
throws java.io.IOException
write(int) method.write in class java.io.FilterWriterc - the character to writejava.io.IOException - if an I/O error occurs.public void write(java.lang.String str)
throws java.io.IOException
write(String) method.write in class java.io.Writerstr - the string to writejava.io.IOException - if an I/O error occurs.public void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
write(String) method.write in class java.io.FilterWriterstr - the string to writeoff - The start offsetlen - The number of characters to writejava.io.IOException - if an I/O error occurs.