Here you can find the source of readInt(ByteArrayInputStream bin)
public static int readInt(ByteArrayInputStream bin) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.ByteArrayInputStream; import java.io.IOException; import java.nio.ByteBuffer; public class Main { /**//from w w w .j a v a 2s .c o m * Reads the next 4 bytes from the stream as integer. */ public static int readInt(ByteArrayInputStream bin) throws IOException { byte[] buffer = new byte[4]; bin.read(buffer); return ByteBuffer.wrap(buffer).getInt(); } }