ParcelFileDescriptorSeekableSource

An Android-specific DirectSeekableSource wrapping a seekable ParcelFileDescriptor for Storage Access Framework (content://) or ContentProvider random access without copying files into cache storage.

Closing this source closes the underlying ParcelFileDescriptor.

Parameters

pfd

a seekable ParcelFileDescriptor opened in read mode.

Constructors

Link copied to clipboard
constructor(pfd: ParcelFileDescriptor)

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.