Skip to content
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

Set ByteOrder.LITTLE_ENDIAN for ByteBuffer from Config.Resource.asByteBuffer #239

Conversation

mh-northlander
Copy link
Collaborator

fix #238.

Add ByteBuffer order argument to StringUtil.readAllBytes and use it to set ByteOrder.LITTLE_ENDIAN for ByteBuffer from Config.Resource.asByteBuffer.

@@ -56,12 +57,20 @@ public static String readFully(InputStream stream) throws IOException {
}

public static ByteBuffer readAllBytes(URL url) throws IOException {
return readAllBytes(url, ByteOrder.BIG_ENDIAN);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is dangerous to go big-endian when we forget to specify endian, so why not default to little-endian?

@mh-northlander mh-northlander merged commit 3fa9866 into WorksApplications:develop Nov 5, 2024
3 checks passed
@mh-northlander mh-northlander deleted the feature/238-align-byteorder branch November 5, 2024 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

byte order of a ByteBuffer returned from Config.Classpath.asByteBuffer may differ
2 participants