class BufferedSource
source · line 9public
public class BufferedSource private constructor(
private val source: ByteSource,
private val internalBuffer: NativeByteBuffer,
private val owner: Closeable?
) : ByteSource, Closeable
- Supertype
ByteSource - Supertype
Closeable - Inherited
fun dispose(): Unit· Closeable
A synchronous read-ahead adapter. Its ordinary constructor borrows the source; takeOwnership transfers source cleanup responsibility. Operations on one adapter must not overlap.
function readInto
source · line 39public
public override fun readInto(buffer: NativeByteBuffer, count: Long): Long
- Overrides
readInto· ByteSource
Reads into the selected writable region, returning actual bytes and permitting short reads. Zero for a positive request denotes EOF.
parameter buffer
source · line 39public
buffer: NativeByteBuffer
parameter count
source · line 39public
count: Long
property isClosed
source · line 20public
public val isClosed: Boolean
get: public read-only
Whether this owned resource has been closed.
getter get
source · line 20public
get(): Boolean
function close
source · line 61public
public override fun close(): Unit
- Overrides
close
Closes internal buffering and the source only when ownership was transferred.
constructor constructor
source · line 22public
constructor(source: ByteSource, capacity: Long = 8192L)
parameter capacity
source · line 22public
capacity: Long = 8192L
parameter source
source · line 22public
source: ByteSource