code: private void append(final StringBuffer buf, final Integer num, final int digits) {
  		if (num == null) {
  			for (int i = 0; i < digits; i++) {
  				buf.append('?');
  			}
  		} else {
  			for (int digit = 1, test = 10; digit < digits; digit++, test *= 10) {
  				if (num < test) {
  					buf.append('0');
  				}
  			}
  
  			buf.append(num);
  		}
  	}
docs: Appends a single date component to the given StringBuffer. Nulls are replaced with question marks, and numbers
  are padded with zeros.
  
  @param buf the buffer to append to.
  @param num the number to append, may be null.
  @param digits the minimum number of digits to append.