Here you can find the source of getDouble(ByteBuffer buffer)
public static double getDouble(ByteBuffer buffer)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static double getDouble(ByteBuffer buffer) { assert (buffer.capacity() - buffer.position() >= 8); long[] data = new long[8]; data[7] = buffer.get();/*from w ww . j ava 2 s.co m*/ data[6] = buffer.get(); data[5] = buffer.get(); data[4] = buffer.get(); data[3] = buffer.get(); data[2] = buffer.get(); data[1] = buffer.get(); data[0] = buffer.get(); return Double .longBitsToDouble(((data[0] << 56) & 0xff00000000000000l) | ((data[1] << 48) & 0x00ff000000000000l) | ((data[2] << 40) & 0x0000ff0000000000l) | ((data[3] << 32) & 0x000000ff00000000l) | ((data[4] << 24) & 0x00000000ff000000l) | ((data[5] << 16) & 0x0000000000ff0000l) | ((data[6] << 8) & 0x000000000000ff00l) | (data[7] & 0x00000000000000ffl)); } }