Convert a big endian 8-byte to a double.
555214
public static double bytes_to_double(byte[] bytes, int offset) {
		try {
			long result = bytes[0+offset] & 0xff;
			result <<= 8;
			result |= bytes[1+offset] & 0xff;
			result <<= 8;
			result |= bytes[2+offset] & 0xff;
			result <<= 8;
			result |= bytes[3+offset] & 0xff;
			result <<= 8;
			result |= bytes[4+offset] & 0xff;
			result <<= 8;
			result |= bytes[5+offset] & 0xff;
			result <<= 8;
			result |= bytes[6+offset] & 0xff;
			result <<= 8;
			result |= bytes[7+offset] & 0xff;
			return Double.longBitsToDouble(result);
		} catch (IndexOutOfBoundsException x) {
			throw new PickleException("decoding double: too few bytes");
		}
	}
1341326
def read_plain_double(file_obj, count):
    """"""
    return struct.unpack("<{}d".format(count).encode("utf-8"), file_obj.read(8 * count))
360997
def _unpack_int_base128(varint, offset):
        """"""
        res = ord(varint[offset])
        if ord(varint[offset]) >= 0x80:
            offset += 1
            res = ((res - 0x80) << 7) + ord(varint[offset])
            if ord(varint[offset]) >= 0x80:
                offset += 1
                res = ((res - 0x80) << 7) + ord(varint[offset])
                if ord(varint[offset]) >= 0x80:
                    offset += 1
                    res = ((res - 0x80) << 7) + ord(varint[offset])
                    if ord(varint[offset]) >= 0x80:
                        offset += 1
                        res = ((res - 0x80) << 7) + ord(varint[offset])
        return res, offset + 1
739734
public static long readUnsignedIntegerLittleEndian(byte[] buffer, int offset) {
		long value;
		value = (buffer[offset] & 0xFF);
		value |= (buffer[offset + 1] & 0xFF) << 8;
		value |= (buffer[offset + 2] & 0xFF) << 16;
		value |= ((long)(buffer[offset + 3] & 0xFF)) << 24;
		return value;
	}
1221276
def int_to_bin(i):
    
    # devide in two parts (bytes)
    i1 = i % 256
    i2 = int(i / 256)
    # make string (little endian)
    return chr(i1) + chr(i2)
541820
def write_double(self, number):
        
        buf = pack(self.byte_order + "d", number)
        self.write(buf)
5623
private static double doubleHighPart(double d) {
        if (d > -Precision.SAFE_MIN && d < Precision.SAFE_MIN){
            return d; // These are un-normalised - don't try to convert
        }
        long xl = Double.doubleToLongBits(d);
        xl = xl & MASK_30BITS; // Drop low order bits
        return Double.longBitsToDouble(xl);
    }
1255566
def encode_int(v):
    """"""
    if not is_numeric(v) or v < 0 or v >= TT256:
        raise Exception("Integer invalid or out of range: %r" % v)
    return int_to_big_endian(v)
1153937
def endianSwapU16(bytes):
    """"""
    for b in range(0, len(bytes), 2):
        bytes[b], bytes[b + 1] = bytes[b + 1], bytes[b]
    return bytes
196544
def _eight_byte_real_to_float(value):
    
    short1, short2, long3 = struct.unpack('>HHL', value)
    exponent = (short1 & 0x7f00) // 256 - 64
    mantissa = (((short1 & 0x00ff) * 65536 + short2) * 4294967296 +
                long3) / 72057594037927936.0
    if short1 & 0x8000:
        return -mantissa * 16.**exponent
    return mantissa * 16.**exponent
931893
public static void writeLongLittleEndian(ByteBuffer io, long value) {
		io.put((byte)(value & 0xFF));
		io.put((byte)((value >> 8) & 0xFF));
		io.put((byte)((value >> 16) & 0xFF));
		io.put((byte)((value >> 24) & 0xFF));
		io.put((byte)((value >> 32) & 0xFF));
		io.put((byte)((value >> 40) & 0xFF));
		io.put((byte)((value >> 48) & 0xFF));
		io.put((byte)((value >> 56) & 0xFF));
	}
966467
public static int toShort(byte[] b, int off, boolean littleEndian) {
		if (littleEndian) {
			return ((b[off] & 0xFF) | ((b[off + 1] & 0xFF) << 8));
		}
		return (((b[off] & 0xFF) << 8) | (b[off + 1] & 0xFF));
	}
991266
@Pure
	@Inline(value = "EndianNumbers.parseBELong(Double.doubleToLongBits($1))",
			imported = {EndianNumbers.class})
	public static byte[] parseBEDouble(double value) {
		return parseBELong(Double.doubleToLongBits(value));
    }
637321
public static byte[] getBytesLittleEndian(long value) {
		byte[] b = new byte[8];
		b[0] = (byte)(value & 0xFF);
		b[1] = (byte)((value >> 8) & 0xFF);
		b[2] = (byte)((value >> 16) & 0xFF);
		b[3] = (byte)((value >> 24) & 0xFF);
		b[4] = (byte)((value >> 32) & 0xFF);
		b[5] = (byte)((value >> 40) & 0xFF);
		b[6] = (byte)((value >> 48) & 0xFF);
		b[7] = (byte)((value >> 56) & 0xFF);
		return b;
	}
539954
public static long readLongLittleEndian(byte[] buffer, int offset) {
		long value;
		value = (buffer[offset] & 0xFF);
		value |= (buffer[offset + 1] & 0xFF) << 8;
		value |= (buffer[offset + 2] & 0xFF) << 16;
		value |= ((long)(buffer[offset + 3] & 0xFF)) << 24;
		value |= ((long)(buffer[offset + 4] & 0xFF)) << 32;
		value |= ((long)(buffer[offset + 5] & 0xFF)) << 40;
		value |= ((long)(buffer[offset + 6] & 0xFF)) << 48;
		value |= ((long)(buffer[offset + 7] & 0xFF)) << 56;
		return value;
	}
96782
public static long bytesToLong(byte[] bytes) {
    long l = 0;
    for (int i = 0; i < 0 + 8; i++) {
      l <<= 8;
      l ^= bytes[i] & 0xFF;
    }
    return l;
  }
795367
def read_int64(self, little_endian=True):
        
        if little_endian:
            endian = "<"
        else:
            endian = ">"
        return self.unpack('%sq' % endian, 8)