try {
// We configure Attachments to buffer MIME parts in memory. If the part content is not
// streamed, then this will result in an OOM error.
Attachments attachments = new Attachments(pipeIn, message.getContentType());
DataHandlerExt dh = (DataHandlerExt)attachments.getDataHandler("part2@apache.org");
IOTestUtils.compareStreams(dataSource.getInputStream(), dh.readOnce());
} finally {
pipeIn.close();
}
}