Last active
June 18, 2016 00:31
-
-
Save vrunoa/b6e6b4badc8d280de7d79f5b22a7e66a to your computer and use it in GitHub Desktop.
chunkBuffer.java
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
public byte[] chunk(ByteBuffer buffer) { | |
byte[] finalBuffer = new byte[buffer.limit()-buffer.remaining()]; | |
ByteBuffer target = ByteBuffer.wrap(finalBuffer); | |
target.order(ByteOrder.LITTLE_ENDIAN); | |
target.put(buffer.array(), 0, buffer.position()); | |
retur finalBuffer | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment