OutputStream, a
ByteSink is not an open, stateful stream that can be written to and closed. Instead, it
is an immutable supplier of OutputStream instances.
ByteSink provides two kinds of methods:
| Modifier and Type | Class and Description |
|---|---|
| private class | ByteSink.
A char sink that encodes written characters with a charset and writes resulting bytes to this byte sink. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public CharSink | asCharSink(Charset charset)
Returns a |
| public OutputStream | |
| public abstract OutputStream | |
| public void | |
| public long | Returns: the number of bytes writtenWrites all the bytes from the given |
| ByteSink | back to summary |
|---|---|
| protected ByteSink() Constructor for use by subclasses. | |
| asCharSink | back to summary |
|---|---|
| public CharSink asCharSink(Charset charset) Returns a | |
| openBufferedStream | back to summary |
|---|---|
| public OutputStream openBufferedStream() throws IOException Opens a new buffered The caller is responsible for ensuring that the returned stream is closed.
| |
| openStream | back to summary |
|---|---|
| public abstract OutputStream openStream() throws IOException Opens a new The caller is responsible for ensuring that the returned stream is closed.
| |
| write | back to summary |
|---|---|
| public void write(byte[] bytes) throws IOException Writes all the given bytes to this sink.
| |
| writeFrom | back to summary |
|---|---|
| public long writeFrom(InputStream input) throws IOException Writes all the bytes from the given
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Writer | openStream()
Implements abstract com. Writer for writing to this sink.
|
| public String |
| charset | back to summary |
|---|---|
| private final Charset charset | |
| AsCharSink | back to summary |
|---|---|
| private AsCharSink(Charset charset) | |
| openStream | back to summary |
|---|---|
| public Writer openStream() throws IOException Implements abstract com. Doc from com. Opens a new The caller is responsible for ensuring that the returned writer is closed.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |