public interface Writer
For compatibility with GWT, the native Java Writer
implementation cannot be used.
WriterAdapter,
StringW| 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.
|
default void |
write(String str)
Writes a string.
|
void |
write(String str,
int start,
int length)
Writes a portion of a string.
|
void write(char ch)
throws IOException
Subclasses that intend to support efficient single-character output should override this method.
ch - int specifying a character to be writtenIOException - If an I/O error occursdefault void write(String str) throws IOException
str - String to be writtenIOException - If an I/O error occursvoid write(String str, int start, int length) throws IOException
str - A Stringstart - Offset from which to start writing characterslength - Number of characters to writeIndexOutOfBoundsException - If off is negative, or len is negative, or
off+len is negative or greater than the length of the
given stringIOException - If an I/O error occursvoid flush()
throws IOException
IOException - If an I/O error occursvoid close()
throws IOException
IOException - If an I/O error occursCopyright © 2021. All rights reserved.