Skip to content

Instantly share code, notes, and snippets.

@yoshiyoshifujii
Created July 15, 2017 03:02
Show Gist options
  • Save yoshiyoshifujii/ba7c9f3b8450e6a858f840bab3fe63c2 to your computer and use it in GitHub Desktop.
Save yoshiyoshifujii/ba7c9f3b8450e6a858f840bab3fe63c2 to your computer and use it in GitHub Desktop.
def readAsByteArray(in: InputStream): Array[Byte] =
Stream.continually(in.read).takeWhile(_ != -1).map(_.toByte).toArray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment