public static float arr2float (byte[] arr, int start) {

            int i = 0;
            int len = 4;
            int cnt = 0;
            byte[] tmp = new byte[len];

            for (i = start; i < (start + len); i++) {
                  tmp[cnt] = arr[i];
                  cnt++;
            }

            int accum = 0;
            i = 0;
            for ( int shiftBy = 0; shiftBy < 32; shiftBy += 8 ) {
                  accum |= ( (long)( tmp[i] & 0xff ) ) << shiftBy;
                  i++;
            }
            return Float.intBitsToFloat(accum);
}    

Posted by 짱가쟁이