Code example for AssetFileDescriptor

Methods: createOutputStream

	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())
			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";
Experience pair programming with AI  Get Codota for Java