SeekableInputStream

An AutoCloseable input stream that supports random access by seeking to specific positions within the data source.

This interface provides a common abstraction for stream-based reading operations where the current read pointer can be moved forward or backward.

Inheritors

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
expect abstract fun close()
Link copied to clipboard
abstract fun length(): Long
Link copied to clipboard
abstract fun position(): Long

Returns the current position in the stream.

Link copied to clipboard
abstract fun read(buf: ByteArray): Int
abstract fun read(buf: ByteArray, offset: Int, length: Int): Int
Link copied to clipboard
abstract fun seek(position: Long): Long

abstract fun seek(offset: Long, whence: Int): Long

Sets the offset, measured from whence, at which the next read or write occurs.