-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
None
The correct would be checking for a position > 0, because the remaining bytes always show the remaining space for storing unwrapped data, and the bytes in [0, position[ are always the bytes that have been unwrapped.
Notice that the only moment this condition is not true is when the buffer is flipped to copy unwrapped data (see copyUnwrappedData), but given that happens inside a lock, and that the buffer is compacted right after that, we can check safely for position>0 in hasRemainingData.