Here you can find the source of toLongBE(byte[] src, int offset)
public static final long toLongBE(byte[] src, int offset)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 Jens Kristian Villadsen. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html/* w w w. ja va 2 s . c o m*/ * * Contributors: * Jens Kristian Villadsen - Lead developer, owner and creator ******************************************************************************/ public class Main { /** * 64bit to long */ public static final long toLongBE(byte[] src, int offset) { return (((src[offset] & 0xFFl) << 56l) + ((src[++offset] & 0xFFl) << 48l) + ((src[++offset] & 0xFFl) << 40l) + ((src[++offset] & 0xFFl) << 32l) + ((src[++offset] & 0xFFl) << 24l) + ((src[++offset] & 0xFFl) << 16l) + ((src[++offset] & 0xFFl) << 8l) + (src[++offset] & 0xFFl)); } }