Android Byte Array to Double Convert getDouble(byte[] b, int index)

Here you can find the source of getDouble(byte[] b, int index)

Description

get Double

Declaration

public static double getDouble(byte[] b, int index) 

Method Source Code

//package com.java2s;

public class Main {

    public static double getDouble(byte[] b, int index) {
        long l;// w ww.java  2  s .co  m
        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);
        l &= 0xffffffffl;
        l |= ((long) b[index + 4] << 32);
        l &= 0xffffffffffl;
        l |= ((long) b[index + 5] << 40);
        l &= 0xffffffffffffl;
        l |= ((long) b[index + 6] << 48);
        l &= 0xffffffffffffffl;
        l |= ((long) b[index + 7] << 56);
        return Double.longBitsToDouble(l);
    }
}

Related

  1. bytesBE2double(byte[] b, int off)
  2. bytesBE2doubles(byte[] b)
  3. bytesLE2double(byte[] b, int off)
  4. bytesLE2doubles(byte[] b)
  5. getDouble(byte[] buf, boolean bigEndian)
  6. getDouble(byte[] bytes)
  7. toDouble(byte[] b, int pos)
  8. toDouble(byte[] b, int pos, int width)