Here you can find the source of readLong(InputStream in)
public static long readLong(InputStream in) throws IOException
//package com.java2s; import java.io.EOFException; import java.io.IOException; import java.io.InputStream; public class Main { public static long readLong(InputStream in) throws IOException { long b1 = in.read(); long b2 = in.read(); long b3 = in.read(); long b4 = in.read(); long b5 = in.read(); long b6 = in.read(); long b7 = in.read(); long b8 = in.read(); if (b8 == -1) throw new EOFException(); return (long) ((b1 << 56) | (b2 << 48) | (b3 << 40) | (b4 << 32) | (b5 << 24) | (b6 << 16) | (b7 << 8) | (b8));/*from www .j a v a 2s . c om*/ } }