Created
June 26, 2019 08:25
-
-
Save BDOMDev/758fd63184f6bd0bca145c80fb064cf5 to your computer and use it in GitHub Desktop.
Save a ByteArray to a file
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
@Throws(Exception::class) | |
fun saveFile(fileData: ByteArray, path: String) { | |
val file = File(path) | |
val bos = BufferedOutputStream(FileOutputStream(file, false)) | |
bos.write(fileData) | |
bos.flush() | |
bos.close() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment