public int copyResource(final Uri packageURI,ContainerEncryptionParams encryptionParams,ParcelFileDescriptor outStream){
  if (packageURI == null || outStream == null) {
    return PackageManager.INSTALL_FAILED_INVALID_URI;
  }
  ParcelFileDescriptor.AutoCloseOutputStream autoOut=new ParcelFileDescriptor.AutoCloseOutputStream(outStream);
  try {
    copyFile(packageURI,autoOut,encryptionParams);
    return PackageManager.INSTALL_SUCCEEDED;
  }
 catch (  FileNotFoundException e) {
    Slog.e(TAG,"Could not copy URI " + packageURI.toString() + " FNF: "+ e.getMessage());
    return PackageManager.INSTALL_FAILED_INVALID_URI;
  }
catch (  IOException e) {
    Slog.e(TAG,"Could not copy URI " + packageURI.toString() + " IO: "+ e.getMessage());
    return PackageManager.INSTALL_FAILED_INSUFFICIENT_STORAGE;
  }
catch (  DigestException e) {
    Slog.e(TAG,"Could not copy URI " + packageURI.toString() + " Security: "+ e.getMessage());
    return PackageManager.INSTALL_FAILED_INVALID_APK;
  }
}

public int copyResource ( final Uri packageURI , ContainerEncryptionParams encryptionParams , ParcelFileDescriptor outStream ) { if ( packageURI == null || outStream == null ) { return PackageManager . INSTALL_FAILED_INVALID_URI ; } ParcelFileDescriptor . AutoCloseOutputStream autoOut = new ParcelFileDescriptor . AutoCloseOutputStream ( outStream ) ; try { copyFile ( packageURI , autoOut , encryptionParams ) ; return PackageManager . INSTALL_SUCCEEDED ; } catch ( FileNotFoundException e ) { Slog . e ( TAG , "Could not copy URI " + packageURI . toString ( ) + " FNF: " + e . getMessage ( ) ) ; return PackageManager . INSTALL_FAILED_INVALID_URI ; } catch ( IOException e ) { Slog . e ( TAG , "Could not copy URI " + packageURI . toString ( ) + " IO: " + e . getMessage ( ) ) ; return PackageManager . INSTALL_FAILED_INSUFFICIENT_STORAGE ; } catch ( DigestException e ) { Slog . e ( TAG , "Could not copy URI " + packageURI . toString ( ) + " Security: " + e . getMessage ( ) ) ; return PackageManager . INSTALL_FAILED_INVALID_APK ; } }
copy specified resource to output stream
