List of utility methods to do Byte Array to Float Convert
float | ByteToFloat(byte[] b) Byte To Float return Float.intBitsToFloat(ByteToInt(b));
|
float | bytesBE2float(byte[] b, int off) bytes B Efloat return Float.intBitsToFloat(bytesBE2int(b, off)); |
float[] | bytesBE2floats(byte[] b) bytes B Efloats if (b == null) return null; if ((b.length & 0x3) != 0) throw new IllegalArgumentException("byte[" + b.length + "]"); float[] val = new float[b.length >> 2]; for (int i = 0; i < val.length; i++) val[i] = bytesBE2float(b, i << 2); return val; ... |
double[] | bytesBE2floats2doubles(byte[] b) bytes B Efloatsdoubles if (b == null) return null; if ((b.length & 0x3) != 0) throw new IllegalArgumentException("byte[" + b.length + "]"); double[] val = new double[b.length >> 2]; for (int i = 0; i < val.length; i++) val[i] = bytesBE2float(b, i << 2); return val; ... |
float | bytesLE2float(byte[] b, int off) bytes L Efloat return Float.intBitsToFloat(bytesLE2int(b, off)); |
float[] | bytesLE2floats(byte[] b) bytes L Efloats if (b == null) return null; if ((b.length & 0x3) != 0) throw new IllegalArgumentException("byte[" + b.length + "]"); float[] val = new float[b.length >> 2]; for (int i = 0; i < val.length; i++) val[i] = bytesLE2float(b, i << 2); return val; ... |
double[] | bytesLE2floats2doubles(byte[] b) bytes L Efloatsdoubles if (b == null) return null; if ((b.length & 0x3) != 0) throw new IllegalArgumentException("byte[" + b.length + "]"); double[] val = new double[b.length >> 2]; for (int i = 0; i < val.length; i++) val[i] = bytesLE2float(b, i << 2); return val; ... |
float | bytesToFloat(byte[] bytes) bytes To Float if (bytes == null) { return 0f; int value1 = byte2Integer(subByte(bytes, 0, 2)); int value2 = byte2Integer(subByte(bytes, 2)); int rv = Math.round((float) value2 / 100); float rvf = rv / 10.0f; if (value1 < 0) { ... |
float | bytesToFloat(byte[] bytes, int start) bytes To Float FLOAT_BUFFER.position(0);
FLOAT_BUFFER.put(bytes, start, FLOAT_BYTES);
FLOAT_BUFFER.flip();
return FLOAT_BUFFER.getFloat(0);
|
float | getFloat(byte[] b, int index) get Float int l; l = b[index + 0]; l &= 0xff; l |= ((long) b[index + 1] << 8); l &= 0xffff; l |= ((long) b[index + 2] << 16); l &= 0xffffff; l |= ((long) b[index + 3] << 24); ... |