List of utility methods to do Byte Array to Float
float | bytes2float(byte[] b) bytesfloat return bytes2float(b, 0); |
float | bytes2Float(byte[] b, float defaultValue) bytes Float if (b == null || b.length < 4) { return defaultValue; } else { return bytes2Float(b); |
float | bytes2float(byte[] bytes) bytesfloat return Float.intBitsToFloat(bytes2int(bytes)); |
float | bytes2float(byte[] bytes) bytesfloat return Float.intBitsToFloat(bytes2int(bytes)); |
float | bytesToFloat(byte[] b) bytes To Float return Float.intBitsToFloat(bytesToInt(b));
|
float | bytesToFloat(byte[] b, int offset) bytes To Float int l; l = b[offset + 0]; l &= 0xff; l |= ((long) b[offset + 1] << 8); l &= 0xffff; l |= ((long) b[offset + 2] << 16); l &= 0xffffff; l |= ((long) b[offset + 3] << 24); ... |
float | bytesToFloat(byte[] bytes) bytes To Float int l; l = bytes[0]; l &= 0xff; l |= ((long) bytes[1] << 8); l &= 0xffff; l |= ((long) bytes[2] << 16); l &= 0xffffff; l |= ((long) bytes[3] << 24); ... |
float | bytesToFloat(byte[] bytes, int beg) Convert a byte array to float. int bits = 0; bits |= (bytes[beg + 3] & 0xff); bits |= (bytes[beg + 2] & 0xff) << 8; bits |= (bytes[beg + 1] & 0xff) << 16; bits |= (bytes[beg] & 0xff) << 24; return Float.intBitsToFloat(bits); |
float | bytesToFloat(byte[] bytes, int startIndex) Given a byte array, restore it as an int return (Float.intBitsToFloat(bytesToInt(bytes, startIndex)));
|
float | byteToFloat(byte[] b) byte To Float return Float.intBitsToFloat(byteToInt(b));
|