Scoop API

scoop:scoop.platform:0.1.0

BufferedSink

class BufferedSink

source · line 75
public
public class BufferedSink private constructor(
    private val sink: ByteSink,
    private val internalBuffer: NativeByteBuffer,
    private val owner: Closeable?
) : ByteSink, 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.

function close

source · line 137
public
public override fun close(): Unit

Flushes output, then releases internal buffering and an owned sink even when flushing fails.

function flush

source · line 126
public
public override fun flush(): Unit
  • Overrides flush · ByteSink

Writes all pending buffered bytes and flushes the underlying sink.