Here you can find the source of readLong(InputStream is)
public static long readLong(InputStream is) throws IOException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.io.InputStream; public class Main { public static long readLong(InputStream is) throws IOException { byte[] bytes = new byte[8]; is.read(bytes);/*from ww w . ja v a 2 s.c o m*/ return getLong(bytes); } public static long getLong(byte[] b) { return (b[0] & 0xFFL) << 0 | (b[1] & 0xFFL) << 8 | (b[2] & 0xFFL) << 16 | (b[3] & 0xFFL) << 24 | (b[4] & 0xFFL) << 32 | (b[5] & 0xFFL) << 40 | (b[6] & 0xFFL) << 48 | (b[7] & 0xFFL) << 56; } }