Here you can find the source of bytesToLong(byte[] data, int offset)
Parameter | Description |
---|---|
data | a parameter |
offset | a parameter |
public static long bytesToLong(byte[] data, int offset)
//package com.java2s; //License from project: Apache License public class Main { /**//www. j a v a 2s . c om * * @param data * @param offset * @return */ public static long bytesToLong(byte[] data, int offset) { long num = 0; for (int i = offset; i < offset + 8; i++) { num <<= 8; num |= (data[i] & 0xff); } return num; } }