Code example for AssetFileDescriptor

Methods: createOutputStream

0
                return new FileOutputStream(localFile, append);
            } 
            case URI_TYPE_CONTENT:
            case URI_TYPE_RESOURCE: {
                AssetFileDescriptor assetFd = contentResolver.openAssetFileDescriptor(uri, append ? "wa" : "w");
                return assetFd.createOutputStream();
            } 
        } 
        throw new FileNotFoundException("URI not supported by CordovaResourceApi: " + uri);
    } 
     
    public HttpURLConnection createHttpConnection(Uri uri) throws IOException {
        assertBackgroundThread(); 
        return httpClient.open(new URL(uri.toString()));
    } 
     
    // Copies the input to the output in the most efficient manner possible. 
    // Closes both streams. 
    public void copyResource(OpenForReadResult input, OutputStream outputStream) throws IOException {
        assertBackgroundThread(); 
        try {