docs: public static String encodeBase64(byte[] rawData, int lineLength) {
  		if (rawData == null) {
  			return "";
  		}
  		StringBuffer retval = new StringBuffer();
  		int i = 0;
  		int n = 0;
  		for (; i < rawData.length - 2; i += 3) {
  			if (lineLength > 0 && i > 0 && i % lineLength == 0) {
  				retval.append("\n");
  			}
  			//n is a 32 bit number
  			//shift all the way to left first to get rid of sign
  			//  3.shift last 8 bits to left    2.shift next 8 bits left of first 1. start here with last 8 bits shifted into int
  			n = (((rawData[i] << 24) >>> 8) + ((rawData[i + 1] << 24) >>> 16) + ((rawData[i + 2] << 24) >>> 24));
  			//this results in a 24 bit number (stored in 32 bit int)
  			//of which 4 chunks of 6 bits are used to pick characters of base64Chars
  			retval.append(base64Chars.charAt((n >>> 18) & 63));
  			retval.append(base64Chars.charAt((n >>> 12) & 63));
  			retval.append(base64Chars.charAt((n >>> 6) & 63));
  			retval.append(base64Chars.charAt(n & 63));
  		}
  		//finish according to spec
  		if (i + 1 == rawData.length) {
  			n = ((rawData[i] << 24) >>> 8);
  
  			retval.append(base64Chars.charAt((n >>> 18) & 63));
  			retval.append(base64Chars.charAt((n >>> 12) & 63));
  			retval.append("==");
  		}
  		if (i + 2 == rawData.length) {
  			n = ((rawData[i] << 24) >>> 8) + ((rawData[i + 1] << 24) >>> 16);
  
  			retval.append(base64Chars.charAt((n >>> 18) & 63));
  			retval.append(base64Chars.charAt((n >>> 12) & 63));
  			retval.append(base64Chars.charAt((n >>> 6) & 63));
  			retval.append('=');
  		}
  
  		return retval.toString();
  	}