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 aCollectionof writers. This is in contrast toFilterWriterwhich 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
Writerdefines method signatures withthrowsIOException, which in this class are actuallyIOExceptionListcontaining a list ofIOIndexedException.- Since:
- 2.7
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Writerappend(char c)Writerappend(CharSequence csq)Writerappend(CharSequence csq, int start, int end)voidclose()voidflush()Flushes the stream.voidwrite(char[] cbuf)voidwrite(char[] cbuf, int off, int len)Writes a portion of an array of characters.voidwrite(int c)Writes a single character.voidwrite(String str)voidwrite(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:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
public Writer append(CharSequence csq) throws IOException
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
public Writer append(CharSequence csq, int start, int end) throws IOException
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
flush
public void flush() throws IOExceptionFlushes the stream.- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException- If an I/O error occurs
-
write
public void write(char[] cbuf) throws IOException- Overrides:
writein classWriter- Throws:
IOException
-
write
public void write(char[] cbuf, int off, int len) throws IOExceptionWrites a portion of an array of characters.- Specified by:
writein 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(int c) throws IOExceptionWrites a single character.- Overrides:
writein classWriter- Throws:
IOException- If an I/O error occurs
-
write
public void write(String str) throws IOException
- Overrides:
writein classWriter- Throws:
IOException
-
write
public void write(String str, int off, int len) throws IOException
Writes a portion of a string.- Overrides:
writein 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
-
-