The easiest way is to provide an example (IMHO):
Base64.Encoder enc = Base64.getEncoder();
Base64.Encoder encURL = Base64.getUrlEncoder();
byte[] bytes = enc.encode("subjects?_d".getBytes());
byte[] bytesURL = encURL.encode("subjects?_d".getBytes());
System.out.println(new String(bytes));
System.out.println(new String(bytesURL));
Base64.Decoder dec = Base64.getDecoder();
Base64.Decoder decURL = Base64.getUrlDecoder();
byte[] decodedURL = decURL.decode(bytesURL);
byte[] decoded = dec.decode(bytes);
System.out.println(new String(decodedURL));
System.out.println(new String(decoded));
, URL safe
, - .
, , : toBase64
toBase64URL
. :
+
/
toBase64
-
_
toBase64URL
.
, , URI ?; - .