I’m using Java’s DataInputStream with scala to parse some simple binary file (which is very bad exprerience due to the lack of unsigned types, even in scala, but that’s a different story).
However I find myself forced to use mutable data structure, since Java’s streams are inherently state preserving entities.
What’s a good design to wrap Java’s streams with nice functional data structure?
There a project currently in progress which aims to create an IO API for Scala: scala IO
It is inspired by Java 7 NIO API. It is still a WIP, but you might get some interesting ideas out of it. There’s also some samples on how to use it, which can be found here