public abstract class FilterWriter extends Writer
FilterWriter itself provides default methods that pass all requests to the contained stream. Subclasses of
FilterWriter should override some of these methods and may also provide additional methods and fields.
| Modifier and Type | Field and Description |
|---|---|
protected Writer |
out
The underlying character-output stream.
|
| Modifier | Constructor and Description |
|---|---|
protected |
FilterWriter(Writer
Create a new filtered writer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the stream, flushing it first.
|
void |
flush()
Flushes the stream.
|
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
Writes a portion of a string.
|
protected Writerout
protected FilterWriter(Writerout)
out - a Writer object to provide the underlying stream.
NullPointerException - if
out is
null
public void write(int c)
throws IOException
write in class
Writer
c - int specifying a character to be written
IOException - If an I/O error occurs
public void write(char[] cbuf,
int off,
int len)
throws IOException
write in class
Writer
cbuf - Buffer of characters to be written
off - Offset from which to start reading characters
len - Number of characters to be written
IOException - If an I/O error occurs
public void write(Stringstr, int off, int len) throws IOException
write in class
Writer
str - String to be written
off - Offset from which to start reading characters
len - Number of characters to be written
IOException - If an I/O error occurs
public void flush()
throws IOException
flush in interface
Flushable
flush in class
Writer
IOException - If an I/O error occurs
public void close()
throws IOException
Writer
close in interface
Closeable
close in interface
AutoCloseable
close in class
Writer
IOException - If an I/O error occurs