public class Util
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
Util() |
Modifier and Type | Method and Description |
---|---|
static float |
get4ByteFloat(int i1,
int i2,
int i3,
int i4)
Transform 4 bytes in a float.
|
static int |
getIntFromBytes(int... x)
Transform a series of bytes in an int.
|
public static int getIntFromBytes(int... x)
x
- a sequence of ints; each one must represent a byte, so its value
must be included in the range [0, 255]java.lang.IllegalArgumentException
- if at least one of the ints does not
represent a byte, i.e. its value does not belong to the range [0, 255]public static float get4ByteFloat(int i1, int i2, int i3, int i4)
The 32 bits are converted according to the IEEE 754 floating-point
"single format" bit layout, using the Float.intBitsToFloat(int)
method.
i1
- valore compreso nell'intervallo [0,255]i2
- valore compreso nell'intervallo [0,255]i3
- valore compreso nell'intervallo [0,255]i4
- valore compreso nell'intervallo [0,255]© 2015 andynaz - http://andynaz.altervista.org