public static void writeLittleEndianInt(DataOutputStream dataStream,int val) throws IOException {
  int mask=0x000000ff;
  for (int shift=0; shift < 32; shift+=8) {
    dataStream.writeByte(mask & (val >> shift));
  }
}

public static void writeLittleEndianInt ( DataOutputStream dataStream , int val ) throws IOException { int mask = 0x000000ff ; for ( int shift = 0 ; shift < 32 ; shift += 8 ) { dataStream . writeByte ( mask & ( val > > shift ) ) ; } }
writes a little - endian integer to the given dataoutputstream .
