ByteArrayRandomAccessSource

Constructors

Link copied to clipboard
constructor(data: ByteArray)

Properties

Link copied to clipboard
open override val size: Long

Total size in bytes.

Functions

Link copied to clipboard
open fun close()

Release any underlying handle. No-op for in-memory sources.

Link copied to clipboard
open override fun read(offset: Long, into: ByteArray, intoOffset: Int = 0, length: Int = into.size): Int

Read up to length bytes starting at absolute offset into into at intoOffset. Returns the number of bytes read, or -1 at end of source.

Link copied to clipboard

Read exactly length bytes at offset, or fail. Convenience over RandomAccessSource.read.