@Test
public void testBase64() throws Exception  {

    Metadata metadata = new Metadata();
    InputStream stream = getStream("test-documents/testRFC822_base64");
    ContentHandler handler = new BodyContentHandler();
    ParseContext context = new ParseContext();
    context.set(Parser.class, EXTRACT_ALL_ALTERNATIVES_PARSER);
    //need to pass in hint.  Autodetects text/plain
    metadata.set(Metadata.CONTENT_TYPE, "message/rfc822");
    try {
        EXTRACT_ALL_ALTERNATIVES_PARSER.parse(stream, handler, metadata, context);
        //tests correct decoding of base64 text, including ISO-8859-1 bytes into Unicode
        assertContains("Here is some text, with international characters, voil\u00E0!", handler.toString());
    } catch (Exception e) {
        fail("Exception thrown: " + e.getMessage());
    }
}