ByteSource

A byte source represents a source of byte data that can only be consumed one time.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val length: Long?

The length of this byte source, if fixed and known, or null otherwise.

Functions

Link copied to clipboard
abstract fun close()
Link copied to clipboard
abstract suspend fun read(buffer: ByteArray, offset: Int = 0, length: Int = buffer.size - offset): Int

Transfer up to length bytes, writing them into the target buffer array at the specified offset.

Link copied to clipboard
suspend fun ByteSource.readRemaining(limit: Int? = null): ByteArray

Read all remaining bytes out of the receiving ByteSource.

Link copied to clipboard

Convert this byte source into an InputStream.