Here you can find the source of bytesToLong(byte a, byte b, byte c, byte d)
private static long bytesToLong(byte a, byte b, byte c, byte d)
//package com.java2s; //License from project: Apache License public class Main { private static long bytesToLong(byte a, byte b, byte c, byte d) { return int2long((((a & 0xff) << 24) | ((b & 0xff) << 16) | ((c & 0xff) << 8) | (d & 0xff))); }/*from ww w . j a v a 2s. c om*/ private static long int2long(int i) { long l = i & 0x7fffffffL; if (i < 0) { l |= 0x080000000L; } return l; } }