public final class ByteArrayUtil extends Object
| Constructor and Description |
|---|
ByteArrayUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyBytes(byte[] source,
int srcStart,
byte[] target,
int tgtStart,
int numBytes)
Copies bytes from source to target with offsets on both the source and target.
|
static double |
getDoubleBE(byte[] array,
int offset)
Get a double from the given byte array starting at the given offset
in big endian order.
|
static double |
getDoubleLE(byte[] array,
int offset)
Get a double from the given byte array starting at the given offset
in little endian order.
|
static float |
getFloatBE(byte[] array,
int offset)
Get a float from the given byte array starting at the given offset
in big endian order.
|
static float |
getFloatLE(byte[] array,
int offset)
Get a float from the given byte array starting at the given offset
in little endian order.
|
static int |
getIntBE(byte[] array,
int offset)
Get a int from the given byte array starting at the given offset
in big endian order.
|
static int |
getIntLE(byte[] array,
int offset)
Get a int from the given byte array starting at the given offset
in little endian order.
|
static long |
getLongBE(byte[] array,
int offset)
Get a long from the source byte array starting at the given offset
in big endian order.
|
static long |
getLongLE(byte[] array,
int offset)
Get a long from the given byte array starting at the given offset
in little endian order.
|
static short |
getShortBE(byte[] array,
int offset)
Get a short from the given byte array starting at the given offset
in big endian order.
|
static short |
getShortLE(byte[] array,
int offset)
Get a short from the given byte array starting at the given offset
in little endian order.
|
static void |
putDoubleBE(byte[] array,
int offset,
double value)
Put the source double into the destination byte array starting at the given offset
in big endian order.
|
static void |
putDoubleLE(byte[] array,
int offset,
double value)
Put the source double into the destination byte array starting at the given offset
in little endian order.
|
static void |
putFloatBE(byte[] array,
int offset,
float value)
Put the source float into the destination byte array starting at the given offset
in big endian order.
|
static void |
putFloatLE(byte[] array,
int offset,
float value)
Put the source float into the destination byte array starting at the given offset
in little endian order.
|
static void |
putIntBE(byte[] array,
int offset,
int value)
Put the source int into the destination byte array starting at the given offset
in big endian order.
|
static void |
putIntLE(byte[] array,
int offset,
int value)
Put the source int into the destination byte array starting at the given offset
in little endian order.
|
static void |
putLongBE(byte[] array,
int offset,
long value)
Put the source long into the destination byte array starting at the given offset
in big endian order.
|
static void |
putLongLE(byte[] array,
int offset,
long value)
Put the source long into the destination byte array starting at the given offset
in little endian order.
|
static void |
putShortBE(byte[] array,
int offset,
short value)
Put the source short into the destination byte array starting at the given offset
in big endian order.
|
static void |
putShortLE(byte[] array,
int offset,
short value)
Put the source short into the destination byte array starting at the given offset
in little endian order.
|
public static void copyBytes(byte[] source,
int srcStart,
byte[] target,
int tgtStart,
int numBytes)
source - the given sourcesrcStart - the source starting indextarget - the give targettgtStart - the target starting indexnumBytes - the number of bytes to be transferred.public static short getShortLE(byte[] array,
int offset)
array - source byte arrayoffset - source offsetpublic static void putShortLE(byte[] array,
int offset,
short value)
array - destination byte arrayoffset - destination offsetvalue - source shortpublic static short getShortBE(byte[] array,
int offset)
array - source byte arrayoffset - source offsetpublic static void putShortBE(byte[] array,
int offset,
short value)
array - destination byte arrayoffset - destination offsetvalue - source shortpublic static int getIntLE(byte[] array,
int offset)
array - source byte arrayoffset - source offsetpublic static void putIntLE(byte[] array,
int offset,
int value)
array - destination byte arrayoffset - destination offsetvalue - source intpublic static int getIntBE(byte[] array,
int offset)
array - source byte arrayoffset - source offsetpublic static void putIntBE(byte[] array,
int offset,
int value)
array - destination byte arrayoffset - destination offsetvalue - source intpublic static long getLongLE(byte[] array,
int offset)
array - source byte arrayoffset - source offsetpublic static void putLongLE(byte[] array,
int offset,
long value)
array - destination byte arrayoffset - destination offsetvalue - source longpublic static long getLongBE(byte[] array,
int offset)
array - source byte arrayoffset - source starting pointpublic static void putLongBE(byte[] array,
int offset,
long value)
array - destination byte arrayoffset - destination starting pointvalue - source longpublic static float getFloatLE(byte[] array,
int offset)
array - source byte arrayoffset - source offsetpublic static void putFloatLE(byte[] array,
int offset,
float value)
array - destination byte arrayoffset - destination offsetvalue - source floatpublic static float getFloatBE(byte[] array,
int offset)
array - source byte arrayoffset - source offsetpublic static void putFloatBE(byte[] array,
int offset,
float value)
array - destination byte arrayoffset - destination offsetvalue - source floatpublic static double getDoubleLE(byte[] array,
int offset)
array - source byte arrayoffset - source offsetpublic static void putDoubleLE(byte[] array,
int offset,
double value)
array - destination byte arrayoffset - destination offsetvalue - source doublepublic static double getDoubleBE(byte[] array,
int offset)
array - source byte arrayoffset - source offsetpublic static void putDoubleBE(byte[] array,
int offset,
double value)
array - destination byte arrayoffset - destination offsetvalue - source doubleCopyright © 2015–2024 The Apache Software Foundation. All rights reserved.