diff --git a/runtimes/java/platforms/androidJNI/AndroidProject/src/com/mosync/internal/android/MoSyncCapture.java b/runtimes/java/platforms/androidJNI/AndroidProject/src/com/mosync/internal/android/MoSyncCapture.java index cb3370554..833c611fc 100644 --- a/runtimes/java/platforms/androidJNI/AndroidProject/src/com/mosync/internal/android/MoSyncCapture.java +++ b/runtimes/java/platforms/androidJNI/AndroidProject/src/com/mosync/internal/android/MoSyncCapture.java @@ -970,8 +970,10 @@ private static boolean copyFile(File sourceFile, File destFile) throws IOExcepti destFile.createNewFile(); } - source = openFile(sourceFile); - destination = openFile(destFile); + //No need to use the extra protection of OpenFile here + // WE will close the resources in the Finally block + source = new FileInputStream(sourceFile).getChannel(); + destination = new FileOutputStream(destFile).getChannel(); destination.transferFrom(source, 0, source.size()); }