-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slices move position of MappedByte underneath user. #512
Comments
@nicktindall could you have a quick look at this? |
It looks like this is potentially a bug in the creation of the slice, and perhaps a quirk of the API. I will write up some tests to pin down what the issue is. One thing that's almost certainly an issue is how the bytes are created when the The failing attempt to read a long from the underlying bytes could just be a misuse of the API. There have been no relative writes to that instance at that point so |
It lazily picks the first chunk and some methods might not be handling that correctly. |
The test provided by issue reporter @TwoClocks is incorrect in it's expectation. Though the |
This explanation doesn't really make much sense.
That's a bug no matter what. Personally, I'd fix it so it works the way people would expect. But if you want to be contrarian, you should at least make it fail consistently. |
Please read respective JavaDocs/README for details. |
Then you should remove |
If you take a slice (
bytesForRead()
) from aMappedBytes
there are instances where if you move the slice, the position in the underlay buffer changes.See PR #511 for an example.
The text was updated successfully, but these errors were encountered: