BufferedSink

interface BufferedSink : Sink

A sink that keeps a buffer internally so that callers can do small writes without a performance penalty.

interface BufferedSink : Sink, WritableByteChannel

Functions

close
Link copied to clipboard
common
abstract override fun close()
Pushes all buffered bytes to their final destination and releases the resources held by this sink.
abstract override fun close()
emit
Link copied to clipboard
common
abstract fun emit(): BufferedSink
Writes all buffered data to the underlying sink, if one exists.
abstract fun emit(): BufferedSink
emitCompleteSegments
Link copied to clipboard
common
abstract fun emitCompleteSegments(): BufferedSink
Writes complete segments to the underlying sink, if one exists.
abstract fun emitCompleteSegments(): BufferedSink
flush
Link copied to clipboard
common
abstract override fun flush()
Writes all buffered data to the underlying sink, if one exists.
abstract override fun flush()
isOpen
Link copied to clipboard
abstract fun isOpen(): Boolean
outputStream
Link copied to clipboard
abstract fun outputStream(): OutputStream
Returns an output stream that writes to this sink.
timeout
Link copied to clipboard
common
abstract fun timeout(): Timeout
Returns the timeout for this sink.
abstract fun timeout(): Timeout
write
Link copied to clipboard
abstract fun write(p0: ByteBuffer): Int
abstract fun write(byteString: ByteString): BufferedSink
abstract fun write(byteString: ByteString, offset: Int, byteCount: Int): BufferedSink
abstract fun write(byteString: ByteString): BufferedSink
abstract fun write(byteString: ByteString, offset: Int, byteCount: Int): BufferedSink
common
abstract fun write(source: ByteArray): BufferedSink
Like OutputStream.
abstract fun write(source: ByteArray): BufferedSink
common
abstract fun write(source: Source, byteCount: Long): BufferedSink
Removes byteCount bytes from source and appends them to this sink.
abstract fun write(source: Source, byteCount: Long): BufferedSink
common
abstract fun write(source: Buffer, byteCount: Long)
Removes byteCount bytes from source and appends them to this.
abstract fun write(source: Buffer, byteCount: Long)
common
abstract fun write(source: ByteArray, offset: Int, byteCount: Int): BufferedSink
Like OutputStream.
abstract fun write(source: ByteArray, offset: Int, byteCount: Int): BufferedSink
writeAll
Link copied to clipboard
common
abstract fun writeAll(source: Source): Long
Removes all bytes from source and appends them to this sink.
abstract fun writeAll(source: Source): Long
writeByte
Link copied to clipboard
common
abstract fun writeByte(b: Int): BufferedSink
Writes a byte to this sink.
abstract fun writeByte(b: Int): BufferedSink
writeDecimalLong
Link copied to clipboard
common
abstract fun writeDecimalLong(v: Long): BufferedSink
Writes a long to this sink in signed decimal form (i.e., as a string in base 10).
abstract fun writeDecimalLong(v: Long): BufferedSink
writeHexadecimalUnsignedLong
Link copied to clipboard
common
abstract fun writeHexadecimalUnsignedLong(v: Long): BufferedSink
Writes a long to this sink in hexadecimal form (i.e., as a string in base 16).
abstract fun writeHexadecimalUnsignedLong(v: Long): BufferedSink
writeInt
Link copied to clipboard
common
abstract fun writeInt(i: Int): BufferedSink
Writes a big-endian int to this sink using four bytes.
abstract fun writeInt(i: Int): BufferedSink
writeIntLe
Link copied to clipboard
common
abstract fun writeIntLe(i: Int): BufferedSink
Writes a little-endian int to this sink using four bytes.
abstract fun writeIntLe(i: Int): BufferedSink
writeLong
Link copied to clipboard
common
abstract fun writeLong(v: Long): BufferedSink
Writes a big-endian long to this sink using eight bytes.
abstract fun writeLong(v: Long): BufferedSink
writeLongLe
Link copied to clipboard
common
abstract fun writeLongLe(v: Long): BufferedSink
Writes a little-endian long to this sink using eight bytes.
abstract fun writeLongLe(v: Long): BufferedSink
writeShort
Link copied to clipboard
common
abstract fun writeShort(s: Int): BufferedSink
Writes a big-endian short to this sink using two bytes.
abstract fun writeShort(s: Int): BufferedSink
writeShortLe
Link copied to clipboard
common
abstract fun writeShortLe(s: Int): BufferedSink
Writes a little-endian short to this sink using two bytes.
abstract fun writeShortLe(s: Int): BufferedSink
writeString
Link copied to clipboard
abstract fun writeString(string: String, charset: Charset): BufferedSink
abstract fun writeString(string: String, beginIndex: Int, endIndex: Int, charset: Charset): BufferedSink
writeUtf8
Link copied to clipboard
common
abstract fun writeUtf8(string: String): BufferedSink
Encodes string in UTF-8 and writes it to this sink.
abstract fun writeUtf8(string: String): BufferedSink
common
abstract fun writeUtf8(string: String, beginIndex: Int, endIndex: Int): BufferedSink
Encodes the characters at beginIndex up to endIndex from string in UTF-8 and writes it to this sink.
abstract fun writeUtf8(string: String, beginIndex: Int, endIndex: Int): BufferedSink
writeUtf8CodePoint
Link copied to clipboard
common
abstract fun writeUtf8CodePoint(codePoint: Int): BufferedSink
Encodes codePoint in UTF-8 and writes it to this sink.
abstract fun writeUtf8CodePoint(codePoint: Int): BufferedSink

Properties

buffer
Link copied to clipboard
abstract val buffer: Buffer
This sink's internal buffer.
abstract val buffer: Buffer

Inheritors

Buffer
Link copied to clipboard