ByteArraySeekableSource

An in-memory SeekableSource backed directly by a ByteArray.

Reading from this source copies slices from bytes without additional buffering, and close is a no-op.

Parameters

bytes

the byte array containing the raw archive data.

See also

Constructors

Link copied to clipboard
constructor(bytes: ByteArray)

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun length(): Long

Returns the total size of the underlying data source in bytes.

Link copied to clipboard
open override fun position(): Long

Returns the current zero-based read offset in bytes from the beginning of the stream.

Link copied to clipboard
open override fun read(buffer: ByteArray, offset: Int, length: Int): Int

Reads up to length bytes from the current position into buffer starting at offset.

Link copied to clipboard
open override fun seek(position: Long)

Sets the absolute byte offset from the beginning of the stream for the next read operation.