Created
May 24, 2020 16:39
-
-
Save dinorahto/5f438859533320a1c500045c425cba07 to your computer and use it in GitHub Desktop.
This file contains 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
//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