Skip to content
Advertisement

Tag: base64

Is Java 8 java.util.Base64 a drop-in replacement for sun.misc.BASE64?

Question Are the Java 8 java.util.Base64 MIME Encoder and Decoder a drop-in replacement for the unsupported, internal Java API sun.misc.BASE64Encoder and sun.misc.BASE64Decoder? EDIT (Clarification): By drop-in replacement I mean that I can switch legacy code using sun.misc.BASE64Encoder and sun.misc.BASE64Decoder to Java 8 MIME Base64 Encoder/Decoder for any existing other client code transparently. What I think so far and why Based

Convert base64 string to image

I am trying to crop/resize user profile image using jquery plugin namely crop.js which sends user image as base64 via ajax to my controller as but I unable to decode this base64 string as Image,Can you guys guide me how can I save my base64 string as image on my server?. Answer This assumes a few things, that you know

Does anyone know how to decode and encode a string in Base64 using Base64?

I am using the following code, but it’s not working. Answer First: Choose an encoding. UTF-8 is generally a good choice; stick to an encoding which will definitely be valid on both sides. It would be rare to use something other than UTF-8 or UTF-16. Transmitting end: Encode the string to bytes (e.g. text.getBytes(encodingName)) Encode the bytes to base64 using

How to get the JAR file for sun.misc.BASE64Encoder class?

I have some code in my Activity class that uses sun.misc.BASE64Encoder class. But it is showing java.lang.NoClassDefFoundError : sun.misc.BASE64Encoder. Do I need the jar? Where can I download it from? Answer Don’t use sun.* classes. For Base64 in Android, use its native class or add a library to your project that does this (Apache commons, etc.). Alternatively just copy the

Base64 decoding using JDK6 only

This question with regard to JDK 5 says, there is no implementation provided with JDK 5, but JDK 6 is supposed to have a sun.misc.Base64Decoder. As far as I can tell though, this class is not provided with the JDK and I was not able to find any other similar classes in itSo, what is the situation like with JDK6?I

Decode base64Url in Java

https://web.archive.org/web/20110422225659/https://en.wikipedia.org/wiki/Base64#URL_applications talks about base64Url – Decode a modified Base64 for URL variant exists, where no padding ‘=’ will be used, and the ‘+’ and ‘/’ characters of standard Base64 are respectively replaced by ‘-‘ and ‘_’ I created the following function: it returns a very small set of characters that don’t even resemble to the expected results. any ideas? Answer

Advertisement