Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.2RC2
-
None
-
None
Description
The following code is taken from AttachmentPart method getSize():
public int getSize() throws SOAPException {
if (datahandler == null)
ByteArrayOutputStream bout = new ByteArrayOutputStream();
try
catch (java.io.IOException ex)
{ log.error(Messages.getMessage("javaIOException00"), ex); throw new SOAPException(Messages.getMessage("javaIOException01", ex.getMessage()), ex); } return bout.size();
}
My understanding is that when the attachment is large the entire attachment will be stored in memory (in the ByteArrayOutputStream). This is unfortunate considering the elegant ManagedMemoryDataSource approach of keeping large attachments out of memory.
The class DimeBodyPart implementation of getDataSize() is perhaps a template for improving this behaviour.