kotlinx-io
kotlinx-io copied to clipboard
[io-2] Make Buffer an interface and add BufferView
trafficstars
I encountered few places where I need to either partially read or partially write Buffer. For example I read some data read from file with limiting window. I would be easily done if I could open for input only part of the buffer. It would be quite easy to implement if Buffer would be an interface and not an expected class. I think it is a good idea to make it an interface in any case since we probably will want to have multiple buffer implementations for a single platform. It should not affect performance.