Code example for AssetFileDescriptor

                // If the cursor is null, throw an exception 
                throw new FileNotFoundException("Unable to query " + uri);
            // Start a new thread that pipes the stream data back to the caller. 
            return new AssetFileDescriptor(
                    openPipeHelper(uri, mimeTypes[0], opts, c, this), 0,
        // If the MIME type is not supported, return a read-only handle to the file. 
        return super.openTypedAssetFile(uri, mimeTypeFilter, opts);
     * Implementation of {@link android.content.ContentProvider.PipeDataWriter} 
     * to perform the actual work of converting the data in one of cursors to a 
     * stream of data for the client to read. 
    public void writeDataToPipe(ParcelFileDescriptor output, Uri uri, String mimeType,
Stop searching for code, let great code find you!  Add Codota to your java IDE