Repository navigation
V07 Android Support - #180
Merged
Merged
Conversation
Member
Author
|
@komamitsu Could you review these changes? Although the following warnings will be shown in Android, these instance methods (getXXX, putXXX, etc.) will be replaced with MessageBufferU's implementation. |
Member
There was a problem hiding this comment.
Minor: Can we replace these lines with java.nio.ByteOrder#nativeOrder?
Member
Author
There was a problem hiding this comment.
Maybe. ByteOrder.nativeOrder is doing almost the same thing:
static ByteOrder byteOrder() {
if (byteOrder != null)
return byteOrder;
long a = unsafe.allocateMemory(8);
try {
unsafe.putLong(a, 0x0102030405060708L);
byte b = unsafe.getByte(a);
switch (b) {
case 0x01: byteOrder = ByteOrder.BIG_ENDIAN; break;
case 0x08: byteOrder = ByteOrder.LITTLE_ENDIAN; break;
default:
throw new Error("Unknown byte order");
}
} finally {
unsafe.freeMemory(a);
}
return byteOrder;
}
But I'm not sure this method is properly implemented for all platforms.
Member
|
Looks good. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For fixing #101, added several workarounds that include:
This PR is basd on v07-universal-buffer branch.