code: public void write_un(int bits, int n) throws IOException {
  		int mask = 1;
  		for(int i=0;i<n;++i) {
  			boolean bit = (bits & mask) != 0;
  			write_bit(bit);
  			mask = mask << 1;
  		}
  	}
docs: Write an unsigned integer value using n bits using a big-endian encoding.
  
  @param w
  @throws IOException