Writer, a
CharSink is not an open, stateful stream that can be written to and closed. Instead, it
is an immutable supplier of Writer instances.
CharSink provides two kinds of methods:
Any ByteSink may be viewed as a CharSink with a specific character encoding using ByteSink#asCharSink(Charset). Characters written to the
resulting CharSink will written to the ByteSink as encoded bytes.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Writer | |
| public abstract Writer | |
| public void | |
| public long | |
| public void | writeLines(Iterable<? extends CharSequence> lines)
Writes the given lines of text to this sink with each line (including the last) terminated with the operating system's default line separator. |
| public void | writeLines(Iterable<? extends CharSequence> lines, String lineSeparator)
Writes the given lines of text to this sink with each line (including the last) terminated with the given line separator. |
| public void | writeLines(Stream<? extends CharSequence> lines)
Writes the given lines of text to this sink with each line (including the last) terminated with the operating system's default line separator. |
| public void | writeLines(Stream<? extends CharSequence> lines, String lineSeparator)
Writes the given lines of text to this sink with each line (including the last) terminated with the given line separator. |
| private void |
| CharSink | back to summary |
|---|---|
| protected CharSink() Constructor for use by subclasses. | |
| openBufferedStream | back to summary |
|---|---|
| public Writer openBufferedStream() throws IOException Opens a new buffered The caller is responsible for ensuring that the returned writer is closed.
| |
| openStream | back to summary |
|---|---|
| public abstract Writer openStream() throws IOException Opens a new The caller is responsible for ensuring that the returned writer is closed.
| |
| write | back to summary |
|---|---|
| public void write(CharSequence charSequence) throws IOException Writes the given character sequence to this sink.
| |
| writeFrom | back to summary |
|---|---|
| public long writeFrom(Readable readable) throws IOException Writes all the text from the given
| |
| writeLines | back to summary |
|---|---|
| public void writeLines(Iterable<? extends CharSequence> lines) throws IOException Writes the given lines of text to this sink with each line (including the last) terminated with
the operating system's default line separator. This method is equivalent to
| |
| writeLines | back to summary |
|---|---|
| public void writeLines(Iterable<? extends CharSequence> lines, String lineSeparator) throws IOException Writes the given lines of text to this sink with each line (including the last) terminated with the given line separator.
| |
| writeLines | back to summary |
|---|---|
| public void writeLines(Stream<? extends CharSequence> lines) throws IOException Writes the given lines of text to this sink with each line (including the last) terminated with
the operating system's default line separator. This method is equivalent to
| |
| writeLines | back to summary |
|---|---|
| public void writeLines(Stream<? extends CharSequence> lines, String lineSeparator) throws IOException Writes the given lines of text to this sink with each line (including the last) terminated with the given line separator.
| |
| writeLines | back to summary |
|---|---|
| private void writeLines(Iterator<? extends CharSequence> lines, String lineSeparator) throws IOException | |