Skip to content

Instantly share code, notes, and snippets.

@smokelaboratory
Created March 16, 2020 04:09
Show Gist options
  • Select an option

  • Save smokelaboratory/6c6e68cc87406f994b8aec7a90fb15b4 to your computer and use it in GitHub Desktop.

Select an option

Save smokelaboratory/6c6e68cc87406f994b8aec7a90fb15b4 to your computer and use it in GitHub Desktop.
Encrypt Decrypt file
//save data
encryptedFile.openFileOutput().use { outputstream ->
outputstream.write(et_data.text.toString().toByteArray())
}
//read data
encryptedFile.openFileInput().use { inputstream ->
tv_result.text = String(inputstream.readBytes(), Charsets.UTF_8)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment