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:
Johannes Schindelin 2013-10-17 14:52:38 -05:00
parent 320fc511dc
commit 4f83f8dd98

View File

@ -244,4 +244,13 @@ public abstract class ByteBuffer
protected void checkGet(int position, int amount) {
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;
}
}