public class ProxyCollectionWriter extends FilterCollectionWriter
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
.Constructor and Description |
---|
ProxyCollectionWriter(java.util.Collection<java.io.Writer> writers)
Creates a new proxy collection writer.
|
ProxyCollectionWriter(java.io.Writer... writers)
Creates a new proxy collection writer.
|
Modifier and Type | Method and Description |
---|---|
java.io.Writer |
append(char c)
Invokes the delegates'
append(char) methods. |
java.io.Writer |
append(java.lang.CharSequence csq)
Invokes the delegates'
append(CharSequence) methods. |
java.io.Writer |
append(java.lang.CharSequence csq,
int start,
int end)
Invokes the delegates'
append(CharSequence, int, int) methods. |
void |
close()
Invokes the delegate's
close() method. |
void |
flush()
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 |
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 ProxyCollectionWriter(java.util.Collection<java.io.Writer> writers)
writers
- Writers object to provide the underlying targets.public ProxyCollectionWriter(java.io.Writer... writers)
writers
- Writers to provide the underlying targets.public java.io.Writer append(char c) throws java.io.IOException
append(char)
methods.append
in interface java.lang.Appendable
append
in class FilterCollectionWriter
c
- 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)
methods.append
in interface java.lang.Appendable
append
in class FilterCollectionWriter
csq
- 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)
methods.append
in interface java.lang.Appendable
append
in class FilterCollectionWriter
csq
- 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.public void close() throws java.io.IOException
close()
method.close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class FilterCollectionWriter
java.io.IOException
- if an I/O error occurs.public void flush() throws java.io.IOException
flush()
method.flush
in interface java.io.Flushable
flush
in class FilterCollectionWriter
java.io.IOException
- if an I/O error occurs.public void write(char[] cbuf) throws java.io.IOException
write(char[])
method.write
in class FilterCollectionWriter
cbuf
- 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 FilterCollectionWriter
cbuf
- 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 FilterCollectionWriter
c
- 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 FilterCollectionWriter
str
- 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 FilterCollectionWriter
str
- the string to writeoff
- The start offsetlen
- The number of characters to writejava.io.IOException
- if an I/O error occurs.Copyright © 2010 - 2023 Adobe. All Rights Reserved