public static String bytesToBase64(byte[] bytes){
  if (bytes == null) {
    return null;
  }
  return Base64.encodeToString(bytes,Base64.NO_WRAP);
}

public static String bytesToBase64 ( byte [ ] bytes ) { if ( bytes == null ) { return null ; } return Base64 . encodeToString ( bytes , Base64 . NO_WRAP ) ; }
encode a byte array as a base64 string . this method should be used to convert from byte [ ] s accepted by crypto . java and strings stored in friendstore .
