public final class WriterAdapter extends Object implements Writer
| Constructor and Description |
|---|
WriterAdapter(Writer out)
Creates a
WriterAdapter. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the stream, flushing it first.
|
void |
flush()
Flushes the stream.
|
void |
write(char ch)
Writes a single character.
|
void |
write(String str,
int start,
int length)
Writes a portion of a string.
|
public WriterAdapter(Writer out)
WriterAdapter.public void write(char ch)
throws IOException
WriterSubclasses that intend to support efficient single-character output should override this method.
write in interface Writerch - int specifying a character to be writtenIOException - If an I/O error occurspublic void write(String str, int start, int length) throws IOException
Writerwrite in interface Writerstr - A Stringstart - Offset from which to start writing characterslength - Number of characters to writeIOException - If an I/O error occurspublic void flush()
throws IOException
Writerflush in interface WriterIOException - If an I/O error occurspublic void close()
throws IOException
Writerclose in interface WriterIOException - If an I/O error occursCopyright © 2021. All rights reserved.