Question

Using Android's Base64, it's possible to do this: Base64.decode(privateKeyString, Base64.DEFAULT). If you are using Apache's Commons Codec, this isn't available. How can I achieve the same result using Commons Codec?

Was it helpful?

Solution

Javadoc for Apache Commons Codec Base64 class can be found here: http://commons.apache.org/proper/commons-codec/archives/1.9/apidocs/org/apache/commons/codec/binary/Base64.html

For your case, you need to use Base64.decodeBase64(String base64String) method

OTHER TIPS

delete the base64 string head.for example,"data:image/png;base64,iVBORw0....",delete the string "data:image/png;base64,".then.it work well. i did it

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top