FileSeekableSource

A JVM and Android DirectSeekableSource backed by a read-only RandomAccessFile and its underlying FileChannel.

Parameters

file

the local archive File to open in read-only mode.

Throws

if file does not exist or cannot be opened for reading.

Constructors

Link copied to clipboard
constructor(file: File)

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.