I have an image that is Base64 encoded. What is the best way to decode that in Java? Hopefully using only the libraries included with Sun Java 6.
Another late answer, but my benchmarking shows that Jetty's implementation of Base64 encoder is pretty fast. Not as fast as MiGBase64 but faster than iHarder Base64.
import org.eclipse.jetty.util.B64Code;
final String decoded = B64Code.decode(encoded, "UTF-8");
I also did some benchmarks:
library | encode | decode
------------------+--------------+-------------
'MiGBase64' | 10146001.00 | 6426446.00
'Jetty B64Code' | 8846191.00 | 3101361.75
'iHarder Base64' | 3259590.50 | 2505280.00
'Commons-Codec' | 241318.04 | 255179.96
These are runs/sec so higher is better.