Skip to content

Instantly share code, notes, and snippets.

@thinkharderdev
Last active November 6, 2018 13:21
Show Gist options
  • Save thinkharderdev/ced83c31392bf612cd91 to your computer and use it in GitHub Desktop.
Save thinkharderdev/ced83c31392bf612cd91 to your computer and use it in GitHub Desktop.
Write raw byte array to File #scala
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