public static String encodeBase64(byte[] input){
  return DatatypeConverter.printBase64Binary(input);
}

public static String encodeBase64 ( byte [ ] input ) { return DatatypeConverter . printBase64Binary ( input ) ; }
creates a base 64 encoded string from the given input bytes .
