19package org.openoffice.xmerge.util;
21import java.nio.ByteBuffer;
22import java.nio.ByteOrder;
44 return ByteBuffer.allocate(2).order(ByteOrder.LITTLE_ENDIAN)
45 .putShort(
value).array();
56 return ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN)
57 .putInt(
value).array();
73 return ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(
90 return ByteBuffer.allocate(2).order(ByteOrder.LITTLE_ENDIAN)
91 .put(
value).getShort(0);
107 return ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN)
108 .put(
value).getInt(0);
124 return Double.longBitsToDouble(
125 ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).put(
value)
Helper class providing static methods to convert data to/from Network Byte Order (Big Endian).
static short readShort(byte[] value)
Convert a Little Endian representation of a short to a Java short (Network Byte Order).
static byte[] writeInt(int value)
Convert an integer to a Little Endian representation.
static byte[] writeShort(short value)
Convert a short to a Little Endian representation.
static int readInt(byte[] value)
Convert a Little Endian representation of an integer to a Java int (Network Byte Order).
static double readDouble(byte[] value)
Convert a Little Endian representation of a float in IEEE-754 Little Endian to a Java double (Network...
static byte[] writeDouble(double value)
Converts a double to a Little Endian representation of a float in IEEE-754 format.