https://kotlinlang.org logo
#io
Title
a

altavir

12/01/2019, 6:12 PM
I've finished migrating my code to io-2. Took a lot of time and some additions to the library. The main problem I've encountered beside few bugs (some of them I've introduced myself and then fixed) is the
Bytes
lifetime. Bytes is a good candidate for intermediate binary data storage between reading and writing, but the problem is that when I get input from it and then dispose it, the
Bytes
itself is disposed so it is really hard to track if it went stale. So the only way to use it safely is to consume it immediatly after creation. I think it makes sense if input from
Bytes
does not dispose
Bytes
on close. It will help to remove double copy in some places.