Lightweight automatic resource management Closes the resource when done e.
Lightweight automatic resource management Closes the resource when done e.g.
for { in <- file.newInputStream.autoClosed } in.write(bytes) // in is closed now
Utility to make a closeable an iterator (auto close when done) e.
Utility to make a closeable an iterator (auto close when done) e.g.
inputStream.autoClosedIterator(_.read())(_ != -1).map(_.toByte)
next element in this resource
a function which tells if there is no more B left
An iterator that closes itself when done