Java Byte Array to Double bytesToDouble(byte[] bytes, int off)

Here you can find the source of bytesToDouble(byte[] bytes, int off)

Description

bytes To Double

License

Open Source License

Declaration

public static double bytesToDouble(byte[] bytes, int off) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static double bytesToDouble(byte[] bytes, int off) {
        long el = 0L;
        int shift = 64;
        int lim = off + 8;
        for (int i = off; i < lim; i++) {
            shift -= 8;// w  w  w.  ja va 2  s .  co m
            el |= (long) (bytes[i] & 0xFF) << shift;
        }
        return Double.longBitsToDouble(el);
    }
}

Related

  1. bytes2double(byte[] b)
  2. bytes2double(byte[] bytes)
  3. bytesToDouble(byte[] buffer)
  4. bytesToDouble(byte[] bytes)
  5. bytesToDouble(byte[] bytes)
  6. bytesToDouble(byte[] bytes, int offset)
  7. bytesToDouble(byte[] bytes, int startIndex)
  8. bytesToDouble(byte[] data, int[] offset)
  9. bytesToDouble(final byte[] bytes)