Java tutorial
//package com.java2s; import java.io.DataInputStream; import java.io.IOException; public class Main { public static int readInt(DataInputStream is) throws IOException { return Integer.reverseBytes(is.readInt()); } }