The AionBuffer is currently written to expose stack-like semantics for encoding/decoding individual primitive values. This should be generalized into the modal queue sort of semantics exposed by ByteBuffer.
For the most part, this involves splitting size into position and limit, and then changing the methods to only seek forward, never backward.
Additionally, this will involve changing the behaviour of wrap() to set the limit to the capacity and the position to 0 (ideal for stream processing - mostly of interest to ABI-related operations).
Further, this will require the introduction of:
clear() - sets position to 0 and limit to capacity
flip() - sets limit to current position and position to 0
The
AionBuffer
is currently written to expose stack-like semantics for encoding/decoding individual primitive values. This should be generalized into the modal queue sort of semantics exposed byByteBuffer
.For the most part, this involves splitting
size
intoposition
andlimit
, and then changing the methods to only seek forward, never backward.Additionally, this will involve changing the behaviour of
wrap()
to set thelimit
to the capacity and theposition
to0
(ideal for stream processing - mostly of interest to ABI-related operations).Further, this will require the introduction of:
clear()
- setsposition
to0
andlimit
tocapacity
flip()
- setslimit
to currentposition
andposition
to0
rewind()
- setsposition
to0