Other Improvements
Base64
We no longer have to use sun.misc.BASE64Encoder
or org.apache.commons.codec.binary.Base64
. No we can use java.util.Base64 class. This is because the internal APIs were encapsulated and are no longer available.
byte[] toEncode = "dummy string".getBytes();
byte[] encoded = Base64.getEncoder().encode(toEncode);
String encodedString = new String(encoded);
Assert.assertEquals("ZHVtbXkgc3RyaW5n", encodedString);
Unsafe
Unsafe is meant to be used only by internal core Java classes.
Last updated
Was this helpful?