code: public static String toBase64(byte[] byteArray) {
  
          String result = null;
          if (byteArray != null) {
              result = Base64.encodeBase64String(byteArray);
          }
          return result;
      }
docs: Encodes the given byte array as a base-64 String.
  
  @param byteArray The byte array to be encoded.
  @return The byte array encoded using base-64.