Agora Java API Reference for Android
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
io.agora.mediaplayer.AssetsFileReader Class Reference

Public Member Functions

int open (String assetFilePath)
 
long getFileSize ()
 
long seek (long pos)
 
void closeFile ()
 
int read (ByteBuffer readByteBuffer)
 
long getCurrentPosition ()
 

Static Public Member Functions

static boolean checkAssetExists (String assetFilePath)
 

Static Public Attributes

static final String PREFIX_ASSETS = "/assets/"
 

Member Function Documentation

◆ checkAssetExists()

static boolean io.agora.mediaplayer.AssetsFileReader.checkAssetExists ( String  assetFilePath)
static

Check if the assets file exists without actually opening it for reading

Parameters
assetFilePathThe asset file path with PREFIX_ASSETS prefix
Returns
true if the file exists, false otherwise

◆ read()

int io.agora.mediaplayer.AssetsFileReader.read ( ByteBuffer  readByteBuffer)

Read file content to ByteBuffer

Parameters
readByteBufferThe buffer into which bytes are to be transferred
Returns
The number of bytes read, possibly zero, or -1 if the channel has reached end-of-stream, or -2 if other errors