Package org.apache.commons.io.output
Class FilterCollectionWriter
- java.lang.Object
-
- java.io.Writer
-
- org.apache.commons.io.output.FilterCollectionWriter
-
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
- Direct Known Subclasses:
ProxyCollectionWriter
public class FilterCollectionWriter extends Writer
Abstract class for writing filtered character streams to aCollection
of writers. This is in contrast toFilterWriter
which is backed by a singleWriter
.This abstract class provides default methods that pass all requests to the contained writers. Subclasses should likely override some of these methods.
The class
Writer
defines method signatures withthrows
IOException
, which in this class are actuallyIOExceptionList
containing a list ofIOIndexedException
.- Since:
- 2.7
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Writer
append(char c)
Writer
append(CharSequence csq)
Writer
append(CharSequence csq, int start, int end)
void
close()
void
flush()
Flushes the stream.void
write(char[] cbuf)
void
write(char[] cbuf, int off, int len)
Writes a portion of an array of characters.void
write(int c)
Writes a single character.void
write(String str)
void
write(String str, int off, int len)
Writes a portion of a string.-
Methods inherited from class java.io.Writer
nullWriter
-
-
-
-
Method Detail
-
append
public Writer append(char c) throws IOException
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
append
public Writer append(CharSequence csq) throws IOException
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
append
public Writer append(CharSequence csq, int start, int end) throws IOException
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-
flush
public void flush() throws IOException
Flushes the stream.- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
- If an I/O error occurs
-
write
public void write(char[] cbuf, int off, int len) throws IOException
Writes a portion of an array of characters.- Specified by:
write
in classWriter
- Parameters:
cbuf
- Buffer of characters to be writtenoff
- Offset from which to start reading characterslen
- Number of characters to be written- Throws:
IOException
- If an I/O error occurs
-
write
public void write(char[] cbuf) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(int c) throws IOException
Writes a single character.- Overrides:
write
in classWriter
- Throws:
IOException
- If an I/O error occurs
-
write
public void write(String str) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(String str, int off, int len) throws IOException
Writes a portion of a string.- Overrides:
write
in classWriter
- Parameters:
str
- String to be writtenoff
- Offset from which to start reading characterslen
- Number of characters to be written- Throws:
IOException
- If an I/O error occurs
-
-