Buffered Sink
A sink that keeps a buffer internally so that callers can do small writes without a performance penalty.
Inheritors
Properties
Functions
Returns a new sink that buffers writes to sink
. The returned sink will batch writes to sink
. Use this wherever you write to a sink to get an ergonomic and efficient access to data.
Returns a sink that uses cipher to encrypt or decrypt this.
Returns an DeflaterSink that DEFLATE-compresses data to this Sink while writing.
Writes all buffered data to the underlying sink, if one exists. Like flush, but weaker. Call this before this buffered sink goes out of scope so that its data can reach its destination.
Writes complete segments to the underlying sink, if one exists. Like flush, but weaker. Use this to limit the memory held in the buffer to a single segment. Typically application code will not need to call this: it is only necessary when application code writes directly to this sink's buffer.
Writes all buffered data to the underlying sink, if one exists. Then that sink is recursively flushed which pushes data as far as possible towards its ultimate destination. Typically that destination is a network socket or file.
Returns an output stream that writes to this sink.
Like OutputStream.write, this writes a complete byte array to this sink.
Removes byteCount
bytes from source
and appends them to this sink.
Like OutputStream.write, this writes byteCount
bytes of source
, starting at offset
.
Removes byteCount
bytes from source
and appends them to this.
Writes a byte to this sink.
Writes a long to this sink in signed decimal form (i.e., as a string in base 10).
Writes a long to this sink in hexadecimal form (i.e., as a string in base 16).
Writes a big-endian int to this sink using four bytes.
Writes a little-endian int to this sink using four bytes.
Writes a big-endian long to this sink using eight bytes.
Writes a little-endian long to this sink using eight bytes.
Writes a big-endian short to this sink using two bytes.
Writes a little-endian short to this sink using two bytes.
Encodes string
in UTF-8 and writes it to this sink.
Encodes the characters at beginIndex
up to endIndex
from string
in UTF-8 and writes it to this sink.
Encodes codePoint
in UTF-8 and writes it to this sink.