FileDataSourceDesc2

public class FileDataSourceDesc2
extends DataSourceDesc2

java.lang.Object
   ↳ androidx.media2.DataSourceDesc2
     ↳ androidx.media2.FileDataSourceDesc2


Structure for data source descriptor for a file. Used by MediaItem2.

Users should use FileDataSourceDesc2.Builder to create FileDataSourceDesc2.

See also:

Summary

Nested classes

class FileDataSourceDesc2.Builder

This Builder class simplifies the creation of a FileDataSourceDesc2 object. 

Constants

long FD_LENGTH_UNKNOWN

Used when the length of file descriptor is unknown.

Inherited constants

Public methods

FileDescriptor getFileDescriptor()

Return the FileDescriptor of this data source.

long getFileDescriptorLength()

Return the content length associated with the FileDescriptor of this data source.

long getFileDescriptorOffset()

Return the offset associated with the FileDescriptor of this data source.

int getType()

Return the type of data source.

Inherited methods

Constants

FD_LENGTH_UNKNOWN

public static final long FD_LENGTH_UNKNOWN

Used when the length of file descriptor is unknown.

Constant Value: 576460752303423487 (0x07ffffffffffffff)

Public methods

getFileDescriptor

public FileDescriptor getFileDescriptor ()

Return the FileDescriptor of this data source.

Returns
FileDescriptor the FileDescriptor of this data source

getFileDescriptorLength

public long getFileDescriptorLength ()

Return the content length associated with the FileDescriptor of this data source. FD_LENGTH_UNKNOWN means same as the length of source content.

Returns
long the content length associated with the FileDescriptor of this data source

getFileDescriptorOffset

public long getFileDescriptorOffset ()

Return the offset associated with the FileDescriptor of this data source. It's meaningful only when it has been set by the DataSourceDesc2.Builder.

Returns
long the offset associated with the FileDescriptor of this data source

getType

public int getType ()

Return the type of data source.

Returns
int the type of data source