Code example for AndroidRuntimeException

0
     */ 
    public int load(AssetFileDescriptor afd, int priority) {
        if (afd != null) {
            long len = afd.getLength();
            if (len < 0) {
                throw new AndroidRuntimeException("no length for fd");
            } 
            return _load(afd.getFileDescriptor(), afd.getStartOffset(), len, priority);
        } else { 
            return 0; 
        } 
    } 
 
    /** 
     * Load the sound from a FileDescriptor. 
     * 
     * This version is useful if you store multiple sounds in a single 
     * binary. The offset specifies the offset from the start of the file 
     * and the length specifies the length of the sound within the file. 
     * 
     * @param fd a FileDescriptor object