Here you can find the source of readLong(byte[] buff, int pos)
Parameter | Description |
---|---|
buff | the byte array |
pos | the position |
public static long readLong(byte[] buff, int pos)
//package com.java2s; /*/*w w w. j a va 2s . c o m*/ * Copyright 2004-2008 H2 Group. Multiple-Licensed under the H2 License, Version 1.0, and under the Eclipse Public License, Version 1.0 (http://h2database.com/html/license.html). Initial Developer: H2 Group */ public class Main { /** * Read a long value from the byte array at the given position. The most significant byte is read first. * * @param buff * the byte array * @param pos * the position * @return the value */ public static long readLong(byte[] buff, int pos) { return ((long) (readInt(buff, pos)) << 32) + (readInt(buff, pos + 4) & 0xffffffffL); } public static int readInt(byte[] buff, int pos) { return (buff[pos++] << 24) + ((buff[pos++] & 0xff) << 16) + ((buff[pos++] & 0xff) << 8) + (buff[pos] & 0xff); } }