Code example for AssetFileDescriptor

Methods: createOutputStream

0
	@Override 
	public ParcelFileDescriptor openFile(Uri uri, String mode) {
		try { 
			ParcelFileDescriptor[] pipes = ParcelFileDescriptor.createPipe();
			final ParcelFileDescriptor write = pipes[1];
			AssetFileDescriptor afd = new AssetFileDescriptor(write, 0, -1);
			new RequestHandlerSiteNavigation(getContext(), uri, afd.createOutputStream())
					.start(); 
			return pipes[0];
		} catch (IOException e) {
			Log.e(TAG, "Failed to handle request: " + uri, e);
			return null; 
		} 
	} 
	 
	private class SiteNavigationDatabaseHelper extends SQLiteOpenHelper {
		 
		private Context mContext;
	    static final String DATABASE_NAME = "websites.db";
	     
	    public SiteNavigationDatabaseHelper(Context context) {