public static void writeUINT32(long number,OutputStream out) throws IOException {
  if (number < 0) {
    throw new IllegalArgumentException("positive value expected.");
  }
  byte[] toWrite=new byte[4];
  for (int i=0; i <= 24; i+=8) {
    toWrite[i / 8]=(byte)((number >> i) & 0xFF);
  }
  out.write(toWrite);
}

public static void writeUINT32 ( long number , OutputStream out ) throws IOException { if ( number < 0 ) { throw new IllegalArgumentException ( "positive value expected." ) ; } byte [ ] toWrite = new byte [ 4 ] ; for ( int i = 0 ; i <= 24 ; i += 8 ) { toWrite [ i / 8 ] = ( byte ) ( ( number > > i ) & 0xFF ) ; } out . write ( toWrite ) ; }
writes the given value as uint32 into the stream .
