Skip to content

Instantly share code, notes, and snippets.

@abeluck
Created Sep 21, 2012
Embed
What would you like to do?
IOCipher copying using file channels
...
FileOutputStream os = null;
java.io.FileInputStream is = null;
try {
os = new FileOutputStream("/test_file");
is = new java.io.FileInputStream(this.getContentResolver().openInputStream(uri));
FileChannel sourceFileChannel = is.getChannel();
IOCipherFileChannel destinationFileChannel = os.getChannel();
sourceFileChannel.transferTo(0, sourceFileChannel.size(), destinationFileChannel);
sourceFileChannel.close();
destinationFileChannel.close();
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment