List of utility methods to do ByteOrder
int | toFloatByteArray(float val, ByteOrder outOrder, byte[] buf, int off) to Float Byte Array return toInt32ByteArray(Float.floatToIntBits(val), outOrder, buf, off); |
int | toInt(byte[] bytes, ByteOrder order) to Int if (bytes == null) { throw new NullPointerException(); byte[] temp = subArray(bytes, 0, COUNT); if (temp.length < COUNT) { temp = concat(new byte[COUNT - temp.length], temp); int result = 0; ... |
int | toInt16ByteArray(final int val, final ByteOrder outOrder, final byte[] buf, final int off) to Int Byte Array if (null == outOrder) throw new NumberFormatException("toInt16ByteArray(" + val + ") no order specified"); final boolean isBigEndian = ByteOrder.BIG_ENDIAN.equals(outOrder); buf[off] = (byte) ((isBigEndian ? (val >> 8) : val) & 0x00FF); buf[off + 1] = (byte) ((isBigEndian ? val : (val >> 8)) & 0x00FF); return 2; |
int | toInt64ByteArray(final long val, final ByteOrder outOrder, final byte[] buf) to Int Byte Array return toInt64ByteArray(val, outOrder, buf, 0); |