public final class Bits
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static int |
compareNotNull(char[] data1,
char[] data2)
Compare the contents of two char arrays.
|
static int |
compareNotNullSigned(byte[] data1,
byte[] data2)
Compare the contents of two byte arrays.
|
static int |
compareNotNullUnsigned(byte[] data1,
byte[] data2)
Compare the contents of two byte arrays.
|
static double |
readDouble(byte[] buff,
int pos)
Reads a double value from the byte array at the given position in
big-endian order.
|
static double |
readDoubleLE(byte[] buff,
int pos)
Reads a double value from the byte array at the given position in
little-endian order.
|
static int |
readInt(byte[] buff,
int pos)
Reads a int value from the byte array at the given position in big-endian
order.
|
static int |
readIntLE(byte[] buff,
int pos)
Reads a int value from the byte array at the given position in
little-endian order.
|
static long |
readLong(byte[] buff,
int pos)
Reads a long value from the byte array at the given position in
big-endian order.
|
static long |
readLongLE(byte[] buff,
int pos)
Reads a long value from the byte array at the given position in
little-endian order.
|
static byte[] |
uuidToBytes(long msb,
long lsb)
Converts UUID value to byte array in big-endian order.
|
static byte[] |
uuidToBytes(java.util.UUID uuid)
Converts UUID value to byte array in big-endian order.
|
static void |
writeDouble(byte[] buff,
int pos,
double x)
Writes a double value to the byte array at the given position in
big-endian order.
|
static void |
writeDoubleLE(byte[] buff,
int pos,
double x)
Writes a double value to the byte array at the given position in
little-endian order.
|
static void |
writeInt(byte[] buff,
int pos,
int x)
Writes a int value to the byte array at the given position in big-endian
order.
|
static void |
writeIntLE(byte[] buff,
int pos,
int x)
Writes a int value to the byte array at the given position in
little-endian order.
|
static void |
writeLong(byte[] buff,
int pos,
long x)
Writes a long value to the byte array at the given position in big-endian
order.
|
static void |
writeLongLE(byte[] buff,
int pos,
long x)
Writes a long value to the byte array at the given position in
little-endian order.
|
public static int compareNotNull(char[] data1,
char[] data2)
data1 - the first char array (must not be null)data2 - the second char array (must not be null)public static int compareNotNullSigned(byte[] data1,
byte[] data2)
This method interprets bytes as signed.
data1 - the first byte array (must not be null)data2 - the second byte array (must not be null)public static int compareNotNullUnsigned(byte[] data1,
byte[] data2)
This method interprets bytes as unsigned.
data1 - the first byte array (must not be null)data2 - the second byte array (must not be null)public static int readInt(byte[] buff,
int pos)
buff - the byte arraypos - the positionpublic static int readIntLE(byte[] buff,
int pos)
buff - the byte arraypos - the positionpublic static long readLong(byte[] buff,
int pos)
buff - the byte arraypos - the positionpublic static long readLongLE(byte[] buff,
int pos)
buff - the byte arraypos - the positionpublic static double readDouble(byte[] buff,
int pos)
buff - the byte arraypos - the positionpublic static double readDoubleLE(byte[] buff,
int pos)
buff - the byte arraypos - the positionpublic static byte[] uuidToBytes(long msb,
long lsb)
msb - most significant part of UUIDlsb - least significant part of UUIDpublic static byte[] uuidToBytes(java.util.UUID uuid)
uuid - UUID valuepublic static void writeInt(byte[] buff,
int pos,
int x)
buff - the byte arraypos - the positionx - the value to writepublic static void writeIntLE(byte[] buff,
int pos,
int x)
buff - the byte arraypos - the positionx - the value to writepublic static void writeLong(byte[] buff,
int pos,
long x)
buff - the byte arraypos - the positionx - the value to writepublic static void writeLongLE(byte[] buff,
int pos,
long x)
buff - the byte arraypos - the positionx - the value to writepublic static void writeDouble(byte[] buff,
int pos,
double x)
buff - the byte arraypos - the positionx - the value to writepublic static void writeDoubleLE(byte[] buff,
int pos,
double x)
buff - the byte arraypos - the positionx - the value to write