class BufferedSink
source · line 75public
public class BufferedSink private constructor(
private val sink: ByteSink,
private val internalBuffer: NativeByteBuffer,
private val owner: Closeable?
) : ByteSink, Closeable
- Supertype
ByteSink - Supertype
Closeable - Inherited
fun dispose(): Unit· Closeable
A synchronous buffered output adapter. Its ordinary constructor borrows the sink; takeOwnership transfers cleanup responsibility. Close flushes pending output and cleans up owned resources even if flushing fails.
property isClosed
source · line 85public
public val isClosed: Boolean
get: public read-only
Whether this owned resource has been closed.
getter get
source · line 85public
get(): Boolean
function writeFrom
source · line 104public
public override fun writeFrom(buffer: NativeByteBuffer, count: Long): Long
- Overrides
writeFrom· ByteSink
Consumes the selected readable region, returning the actual accepted byte count and permitting short writes.
parameter buffer
source · line 104public
buffer: NativeByteBuffer
parameter count
source · line 104public
count: Long
constructor constructor
source · line 87public
constructor(sink: ByteSink, capacity: Long = 8192L)
parameter capacity
source · line 87public
capacity: Long = 8192L
parameter sink
source · line 87public
sink: ByteSink
function close
source · line 137public
public override fun close(): Unit
- Overrides
close
Flushes output, then releases internal buffering and an owned sink even when flushing fails.
function flush
source · line 126public
public override fun flush(): Unit
- Overrides
flush· ByteSink
Writes all pending buffered bytes and flushes the underlying sink.