mirror of
https://github.com/corda/corda.git
synced 2025-06-18 15:18:16 +00:00
ByteBuffer: add missing order() methods
Avian's ByteBuffer implementation is actually fixed to big endian. So let's throw an exception if the user tries to change that. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@ -244,4 +244,13 @@ public abstract class ByteBuffer
|
|||||||
protected void checkGet(int position, int amount) {
|
protected void checkGet(int position, int amount) {
|
||||||
if (amount > limit-position) throw new IndexOutOfBoundsException();
|
if (amount > limit-position) throw new IndexOutOfBoundsException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ByteBuffer order(ByteOrder order) {
|
||||||
|
if (order != ByteOrder.BIG_ENDIAN) throw new UnsupportedOperationException();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ByteOrder order() {
|
||||||
|
return ByteOrder.BIG_ENDIAN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user