code: private static <T extends Number> String toBitMask(T bitmask, int length) {
  		StringBuilder buffer = new StringBuilder();
  		long bit = 1;
  		for(int i = 0; i < length; ++i) {
  			if(i != 0 && i % 8 == 0) {
  				buffer.append(" ");
  			} else if(i != 0 && i % 4 == 0) {
  				buffer.append(":");
  			}
  			if((bit & bitmask.longValue()) == bit) {
  				buffer.append("1");
  			} else {
  				buffer.append("0");
  			}
  			bit = bit << 1;				
  		}
  		return buffer.reverse().toString();
  	}
docs: Parametric version of the method, which dumps any number as bitmask.
  
  @param bitmask
  the number to be formatted as a bitmask.
  @param length
  the length (in bits) of the type (e.g. int's are 32 bits).
  @return
  a bitmask (1's and 0's) representation of the given Number.