Just wanted to answer this with some more information as people here seem to have missed your requirement for a utility for both Base64 and Quoted Printable.
Take a look at MimeUtility in Javamail here:
http://java.sun.com/products/javamail/javadocs/javax/mail/internet/MimeUtility.html
That provides encoding/decoding for both Base64 and Quoted Printable, amongst others, look at the decode method:
public static InputStream decode(InputStream is,
String encoding) throws MessagingException
Commons Codec provides similar functionality in the form of QCodec and Base64, but no main method that I know of. Hope that helps.