If I implement Input, I need to fill Buffer. What ...
# io
a
If I implement Input, I need to fill Buffer. What are guarantees about Buffer state. Do I need to flip it? Can I use it from start or I need to respect current position?
d
flip?
Buffer
is random access. There no read/write position or state so to speak.
Are you talking about io-1 or io-2?
a
I am taking only about IO-2. I can do flip. The question if I am allowed to do it. For example if I already get half-full buffer, if I flip it, it could ged broken.
Buffer does not have position, but underlying ByteBuffer has and I have to use it to work with Channel.
d
Since it's multi-platform I don't think you should flip it or change it state, only change it's contents.
a
I use it only on JVM and only to use it with JVM channels.