-
Notifications
You must be signed in to change notification settings - Fork 401
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
DirectBuffer.wrap(ByteBuffer) does not respect wrapped buffer ordering #161
Comments
On second thought, the explanation provided for #40 doesn't make sense to me. At the time of this writing Further, sometimes we don't have the ability to mutate the input |
If you look at all the method implementations the byte order of the wrapped buffer is never queried. All operations regarding byte order are stateless. All the accessor method have an overload for byte order with native being default without the additional arg. Your performance point is not correct. I think you are misunderstanding the implementation. |
@mjpt777 If I understand you correctly, you are saying that users should:
Is that correct? |
I'd say know the endianess for the codecs you wish to use in the context of their protocol, then pass |
@mjpt777 I mean no disrespect but I don't understand how you can say that Also, I noticed you updated the documentation for Regarding "know your protocol", makes sense. |
I've updated the Javadoc regarding "stateless". To be clear the wrap methods are the exception. |
To help clarify. It is not immutable because the fields are mutable. It is stateless in that there is no remembered state from one call to the next, e.g. your byte order example. The one exception is wrapping another buffer. |
Following up on #40, please:
wrap()
method (as opposed to a class-level comment) explaining that the input buffer is expected to have native ordering.I have wasted hours debugging problems as a result of this issue.
The text was updated successfully, but these errors were encountered: