Here you can find the source of readLong(DataInput in)
public static long readLong(DataInput in) throws Exception
//package com.java2s; //License from project: LGPL import java.io.*; public class Main { public static long readLong(DataInput in) throws Exception { byte len = in.readByte(); if (len == 0) return 0; byte[] buf = new byte[len]; in.readFully(buf, 0, len);/*from w w w. j a v a 2s.c o m*/ return makeLong(buf, 0, len); } static long makeLong(byte[] buf, int offset, int len) { long retval = 0; for (int i = 0; i < len; i++) { byte b = buf[offset + i]; retval |= ((long) b & 0xff) << (i * 8); } return retval; } }