@Test public void testStop() throws Exception { final MimeStreamParser parser = new MimeStreamParser(); TestHandler handler = new TestHandler() { @Override public void endHeader() { super.endHeader(); parser.stop(); } }; parser.setContentHandler(handler); String msg = "Subject: Yada yada\r\n" + "From: foo@bar.com\r\n" + "\r\n" + "Line 1\r\n" + "Line 2\r\n"; String expected = "<message>\r\n" + "<header>\r\n" + "<field>\r\n" + "Subject: Yada yada" + "</field>\r\n" + "<field>\r\n" + "From: foo@bar.com" + "</field>\r\n" + "</header>\r\n" + "<body>\r\n" + "</body>\r\n" + "</message>\r\n"; parser.parse(new ByteArrayInputStream(msg.getBytes())); String result = handler.sb.toString(); Assert.assertEquals(expected, result); }
public void stop() { mimeTokenStream.stop(); }
MimeStreamParser { public void stop() { mimeTokenStream.stop(); } }
MimeStreamParser { public void stop() { mimeTokenStream.stop(); } MimeStreamParser(MimeTokenStream tokenStream);  MimeStreamParser(
            final MimeConfig config,
            final DecodeMonitor monitor,
            final BodyDescriptorBuilder bodyDescBuilder);  MimeStreamParser(final MimeConfig config);  MimeStreamParser(); }
MimeStreamParser { public void stop() { mimeTokenStream.stop(); } MimeStreamParser(MimeTokenStream tokenStream);  MimeStreamParser(
            final MimeConfig config,
            final DecodeMonitor monitor,
            final BodyDescriptorBuilder bodyDescBuilder);  MimeStreamParser(final MimeConfig config);  MimeStreamParser(); boolean isContentDecoding(); void setContentDecoding(boolean b); void parse(InputStream instream); boolean isRaw(); void setRaw(); void setFlat(); void setRecurse(); void stop(); void setContentHandler(ContentHandler h); }
MimeStreamParser { public void stop() { mimeTokenStream.stop(); } MimeStreamParser(MimeTokenStream tokenStream);  MimeStreamParser(
            final MimeConfig config,
            final DecodeMonitor monitor,
            final BodyDescriptorBuilder bodyDescBuilder);  MimeStreamParser(final MimeConfig config);  MimeStreamParser(); boolean isContentDecoding(); void setContentDecoding(boolean b); void parse(InputStream instream); boolean isRaw(); void setRaw(); void setFlat(); void setRecurse(); void stop(); void setContentHandler(ContentHandler h);  }