Here you can find the source of readLong(InputStream i)
public static final long readLong(InputStream i) throws IOException
//package com.java2s; //License from project: Apache License import java.io.EOFException; import java.io.IOException; import java.io.InputStream; public class Main { public static final long readLong(InputStream i) throws IOException { return ((long) (readInt(i)) << 32) + (readInt(i) & 0xFFFFFFFFL); }/*from www . ja v a 2 s .c o m*/ public static final int readInt(InputStream i) throws IOException, EOFException { InputStream in = i; int ch1 = in.read(); int ch2 = in.read(); int ch3 = in.read(); int ch4 = in.read(); if ((ch1 | ch2 | ch3 | ch4) < 0) throw new EOFException(); return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0)); } }