This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 12.3, “How to read and write binary files in Scala.”
You want to read data from a binary file or write data to a binary file.
Scala doesn’t offer any special conveniences for reading or writing binary files, so use the Java
There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.