aionnetwork / AVM

Enabling Java code to run in a blockchain environment
https://theoan.com/
MIT License
49 stars 25 forks source link

Generalize use-case of AionBuffer #377

Closed jeff-aion closed 5 years ago

jeff-aion commented 5 years ago

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: