Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.9
-
None
-
Patch Available
Description
Currently if someone calls the bufferForField accessor then calls ByteBuffer.get, this mutates the struct's ByteBuffer field. Subsequent calls to bufferForField return the mutated field and thus calls to ByteBuffer.get return unexpected results.
MyStruct myStruct = ...; byte[] array = new byte[myStruct.bufferForValue().capacity()]; someStruct.bufferForValue().get(array); someStruct.bufferForValue().get(array); // previously, NPE