Last active
November 6, 2018 13:21
-
-
Save thinkharderdev/ced83c31392bf612cd91 to your computer and use it in GitHub Desktop.
Write raw byte array to File #scala
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
val bytes = Base64.decodeBase64(dataString.getBytes("UTF-8")) | |
val tempFile = new File(UUID.randomUUID().toString) | |
FileUtils.copy(new ByteArrayInputStream(bytes),new FileOutputStream(tempFile)) | |
TemporaryFile(tempFile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment