code: public static String encodeQ(byte[] bytes, Usage usage) {
  		BitSet qChars = usage == Usage.TEXT_TOKEN ? Q_REGULAR_CHARS : Q_RESTRICTED_CHARS;
  
  		StringBuilder sb = new StringBuilder();
  
  		final int end = bytes.length;
  		for (int idx = 0; idx < end; idx++) {
  			int v = bytes[idx] & 0xff;
  			if (v == 32) {
  				sb.append('_');
  			} else if (!qChars.get(v)) {
  				sb.append('=');
  				sb.append(hexDigit(v >>> 4));
  				sb.append(hexDigit(v & 0xf));
  			} else {
  				sb.append((char) v);
  			}
  		}
  
  		return sb.toString();
  	}
docs: Encodes the specified byte array using the Q encoding defined in RFC 2047.
  
  @param bytes
  byte array to encode.
  @param usage
  whether the encoded-word is to be used to replace a text token or
  a word entity (see RFC 822).
  @return encoded string.