Java examples for java.lang:int Format
read Little Endian Int
//package com.java2s; import java.io.DataInput; import java.io.IOException; public class Main { public static int readLittleEndianInt(DataInput in) throws IOException { int bigEndian = 0; for (int shiftBy = 0; shiftBy < 32; shiftBy += 8) { bigEndian |= (in.readUnsignedByte() & 0xff) << shiftBy; }/*from w w w . j av a 2s. c o m*/ return bigEndian; } }