if (!isReadyToGetNextStream()) {
throw new IllegalStateException("nextStreamNotReady");
}
InternetHeaders headers;
try {
_delimitedStream = _delimitedStream.getNextStream();
if (_delimitedStream == null) {
return null;
}
headers = new InternetHeaders(_delimitedStream);
} catch (IOException ioe) {
ioe.printStackTrace();
throw new OMException(ioe);
} catch (MessagingException me) {
me.printStackTrace();
throw new OMException(me);
}
stream = new IncomingAttachmentInputStream(_delimitedStream, this);
Header header;
String name;
String value;
Enumeration e = headers.getAllHeaders();
while (e != null && e.hasMoreElements()) {
header = (Header) e.nextElement();
name = header.getName();
value = header.getValue();
if (IncomingAttachmentInputStream.HEADER_CONTENT_ID.equals(name)