code: public static byte[] decodeToBytes(String encoded) {
      try {
        byte[] bytes = encoded.getBytes("UTF-8");
        Base64Decoder in = new Base64Decoder(new ByteArrayInputStream(bytes));
  
        ByteArrayOutputStream out = new ByteArrayOutputStream((int) (bytes.length * 0.67));
  
        try {
          byte[] buf = new byte[4 * 1024]; // 4K buffer
          int bytesRead;
          while ((bytesRead = in.read(buf)) != -1) {
            out.write(buf, 0, bytesRead);
          }
          out.close();
  
          return out.toByteArray();
        } catch (IOException ignored) {
          return null;
        }
      } catch (UnsupportedEncodingException ignored) {
        return null;
      }
    }
docs: *
  Returns the decoded form of the given encoded string, as bytes.
  
  @param encoded the string to decode
  @return the decoded form of the encoded string