Here you can find the source of readInt(byte[] in)
public static int readInt(byte[] in)
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; public class Main { public static int readInt(InputStream in) throws IOException { return ByteBuffer.wrap(readByteArray(Integer.BYTES, in)).getInt(); }// w w w . ja va 2s .c om public static int readInt(byte[] in) { return ByteBuffer.wrap(in).getInt(); } public static byte[] readByteArray(int length, InputStream in) throws IOException { byte[] b = new byte[length]; in.read(b); return b; } }