Here you can find the source of longFromBytes(byte b8, byte b7, byte b6, byte b5, byte b4, byte b3, byte b2, byte b1)
public static long longFromBytes(byte b8, byte b7, byte b6, byte b5, byte b4, byte b3, byte b2, byte b1)
//package com.java2s; /*/*w w w . jav a2 s . co m*/ This file is part of Socks via HTTP. This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Socks via HTTP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Socks via HTTP; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ public class Main { public static long longFromBytes(byte b8, byte b7, byte b6, byte b5, byte b4, byte b3, byte b2, byte b1) { long l = 0; l += (((long) b1) & 0xFF); l += (((long) b2) & 0xFF) << 8; l += (((long) b3) & 0xFF) << 16; l += (((long) b4) & 0xFF) << 24; l += (((long) b5) & 0xFF) << 32; l += (((long) b6) & 0xFF) << 40; l += (((long) b7) & 0xFF) << 48; l += (((long) b8) & 0xFF) << 56; return (l); } }