PathSeekableSource

A JVM and Android DirectSeekableSource backed by a read-only Java NIO FileChannel.

Parameters

path

the Java NIO Path to open with StandardOpenOption.READ.

Throws

if an I/O error occurs when opening the channel.

Constructors

Link copied to clipboard
constructor(path: Path)

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(byteBuffer: ByteBuffer): Int

Reads a sequence of bytes from this source at the current position into byteBuffer.

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.