Example #1
0
 /**
  * Converts the input into a byte array.
  *
  * @param d textual data
  * @param ii input info
  * @return decoded string
  * @throws QueryException query exception
  */
 private static byte[] decode(final byte[] d, final InputInfo ii) throws QueryException {
   try {
     return org.basex.util.Base64.decode(d);
   } catch (final IllegalArgumentException ex) {
     throw funCastError(ii, AtomType.B64, ex.getMessage().replaceAll("^.*?: |\\.$", ""));
   }
 }
Example #2
0
 @Override
 public String toString() {
   return Util.info("\"%\"", org.basex.util.Base64.encode(data));
 }
Example #3
0
 @Override
 public byte[] string(final InputInfo ii) throws QueryException {
   return org.basex.util.Base64.encode(binary(ii));
 }