Here you can find the source of byteToLong(final byte[] b)
Parameter | Description |
---|---|
b | Byte array to convert |
public static long byteToLong(final byte[] b)
//package com.java2s; public class Main { /**//from w ww .j a v a 2s . c o m * Converts a given byte array to a long value * * @param b * Byte array to convert * @return Long value */ public static long byteToLong(final byte[] b) { long result = 0; for (int j = 0; j < 8; j++) { result <<= 8; result |= (b[j] & 0xFF); } return result; } }