Skip to content

Instantly share code, notes, and snippets.

@mirceanis
Created November 15, 2018 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mirceanis/a668414fbd137dc48f61a797301deade to your computer and use it in GitHub Desktop.
Save mirceanis/a668414fbd137dc48f61a797301deade to your computer and use it in GitHub Desktop.
pass file across JNI boundary
val target = File(context.getFilesDir(), "my-file")
val fd = ParcelFileDescriptor.open(target, ParcelFileDescriptor.MODE_READ_WRITE).detachFd()
//fd is an int that's ok to be passed to native code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment