Skip to content

Instantly share code, notes, and snippets.

@dinorahto
Created May 24, 2020 16:39
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 dinorahto/5f438859533320a1c500045c425cba07 to your computer and use it in GitHub Desktop.
Save dinorahto/5f438859533320a1c500045c425cba07 to your computer and use it in GitHub Desktop.
//Write to file
encryptedFile.openFileOutput().bufferedWriter().use {
it.write("Hola Mexico! vamos a encriptar esto")
}
//Read from file
val contents = encryptedFile.bufferedReader().useLines { lines ->
lines.fold("") { working, line ->
"$working\n$line"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment