RandomAccessDataSource

A RandomAccessDataSource is used for reading chunks of bytes from file.

Functions

Link copied to clipboard
abstract fun fetchChunk(startOffset: Long, endOffset: Long): ByteArray

Synchronously fetch a chunk of data from a start and end byte offset. This method should be thread safe as it can be called from multiple threads simultaneously. In case of error, throw exception.

Properties

Link copied to clipboard
abstract val size: Long

Get the size of the resource in number of bytes.

Extensions

Link copied to clipboard
fun RandomAccessDataSource.fetchChunkAsync(startOffset: Long, endOffset: Long): Deferred<ByteArray>