Here you can find the source of readInt(InputStream input)
public static int readInt(InputStream input) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; import java.nio.ByteBuffer; public class Main { public static int readInt(InputStream input) throws IOException { byte[] szBytes = new byte[4]; int read = input.read(szBytes); if (read <= 0) { return 0; }//from w w w . j av a 2s . c o m return ByteBuffer.wrap(szBytes).getInt(); } }