Code example for AssetFileDescriptor

Methods: createInputStream

0
    @Override 
    public InputStream createInputStream() throws IOException {
      // NB: Because createInputStream can only be called once per asset  
      // we always create a new file descriptor here. 
      getFileDescriptor(); 
      return fd.createInputStream();
    } 
 
    @Override 
    public String getContentType() {
      // TODO: Support other media if we need to 
      return "audio/mp3"; 
    } 
     
    @Override 
    public long getContentLength() { 
      if( isSimulatingStream() ) { 
        super.getContentLength(); 
      } 
      if (fd == null) {