Skip to content

Instantly share code, notes, and snippets.

@BDOMDev
Created June 26, 2019 08:25
Show Gist options
  • Save BDOMDev/758fd63184f6bd0bca145c80fb064cf5 to your computer and use it in GitHub Desktop.
Save BDOMDev/758fd63184f6bd0bca145c80fb064cf5 to your computer and use it in GitHub Desktop.
Save a ByteArray to a file
@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