Class AssetsFileReader

java.lang.Object
io.agora.mediaplayer.AssetsFileReader

public class AssetsFileReader extends Object
  • Field Details

  • Constructor Details

    • AssetsFileReader

      public AssetsFileReader()
  • Method Details

    • checkAssetExists

      public static boolean checkAssetExists(String assetFilePath)
      Check if the assets file exists without actually opening it for reading
      Parameters:
      assetFilePath - The asset file path with PREFIX_ASSETS prefix
      Returns:
      true if the file exists, false otherwise
    • open

      public int open(String assetFilePath)
    • getFileSize

      public long getFileSize()
    • seek

      public long seek(long pos)
    • closeFile

      public void closeFile()
    • read

      public int read(ByteBuffer readByteBuffer)
      Read file content to ByteBuffer
      Parameters:
      readByteBuffer - The 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
    • getCurrentPosition

      public long getCurrentPosition()