public class EndianUtils
extends java.lang.Object
Constructor and Description |
---|
EndianUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
swapDouble(double value)
Reverses the byte order of the source double value
|
static float |
swapFloat(float value)
Reverses the byte order of the source float value
|
static int |
swapInteger(int value)
Reverses the byte order of the source int value
|
static long |
swapLong(long value)
Reverses the byte order of the source long value
|
static short |
swapShort(short value)
Reverses the byte order of the source short value
|
static java.lang.StringBuilder |
toCharString(java.lang.StringBuilder sb,
int i,
int bytes,
char def) |
static java.lang.String |
toHexString(int i,
boolean littleEndian,
int bytes) |
static java.lang.String |
toInfoString(int info) |
public static short swapShort(short value)
value
- the source valuepublic static int swapInteger(int value)
value
- the source valuepublic static long swapLong(long value)
value
- the source valuepublic static float swapFloat(float value)
value
- the source valuepublic static double swapDouble(double value)
value
- the source valuepublic static java.lang.String toHexString(int i, boolean littleEndian, int bytes)
public static java.lang.StringBuilder toCharString(java.lang.StringBuilder sb, int i, int bytes, char def)
public static java.lang.String toInfoString(int info)