Last active
February 19, 2021 19:22
-
-
Save CapTen101/36d5465f51e570a25e9dcd01ee289933 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| inputStream.close(); | |
| outputStream.close(); | |
| Uri copyImage = Uri.fromFile(copyImageFile); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String nameOfFile = "copyImageFile.jpg" | |
| File copyImageFile = new File(getCacheDir(), nameOfFile); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ParcelFileDescriptor parcelfileDescriptor = this.getContentResolver().openFileDescriptor(selectedImage, "r"); | |
| FileDescriptor fileDescriptor = parcelfileDescriptor.getFileDescriptor(); | |
| FileInputStream inputStream = new FileInputStream(fileDescriptor); | |
| FileChannel inputStreamChannel = inputStream.getChannel(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FileOutputStream outputStream = new FileOutputStream(copyImageFile); | |
| FileChannel outputStreamChannel = outputStream.getChannel(); | |
| inputStreamChannel.transferTo(0, inputStreamChannel.size(), outputStreamChannel); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created OpenThroughParcelFileDescriptor