org.apache.axiom.attachments.impl
Class PartOnMemoryEnhanced
java.lang.Object
org.apache.axiom.attachments.impl.AbstractPart
org.apache.axiom.attachments.impl.PartOnMemoryEnhanced
- All Implemented Interfaces:
- Part
public class PartOnMemoryEnhanced
- extends AbstractPart
PartOnMemoryEnhanced stores the attachment in memory (in non-contigous byte arrays)
This implementation is used for smaller attachments to enhance
performance.
The PartOnMemoryEnhanced object is created by the PartFactory
- See Also:
org.apache.axiom.attachments.impl.PartFactory.
Field Summary |
(package private) java.util.ArrayList |
data
|
(package private) int |
length
|
private static org.apache.commons.logging.Log |
log
|
Constructor Summary |
PartOnMemoryEnhanced(java.util.Hashtable headers,
java.util.ArrayList data,
int length)
Construct a PartOnMemory |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static org.apache.commons.logging.Log log
data
java.util.ArrayList data
length
int length
PartOnMemoryEnhanced
PartOnMemoryEnhanced(java.util.Hashtable headers,
java.util.ArrayList data,
int length)
- Construct a PartOnMemory
- Parameters:
headers
- data
- array list of 4K byte[]length
- (length of data in bytes)
getDataHandler
public javax.activation.DataHandler getDataHandler()
throws javax.mail.MessagingException
- Specified by:
getDataHandler
in interface Part
- Specified by:
getDataHandler
in class AbstractPart
- Returns:
- DataHandler representing this part
- Throws:
javax.mail.MessagingException
getFileName
public java.lang.String getFileName()
throws javax.mail.MessagingException
- Description copied from interface:
Part
- The part may be backed by a file. If that is the case,
this method returns the file name.
- Specified by:
getFileName
in interface Part
- Specified by:
getFileName
in class AbstractPart
- Returns:
-
- Throws:
javax.mail.MessagingException
getInputStream
public java.io.InputStream getInputStream()
throws java.io.IOException,
javax.mail.MessagingException
- Specified by:
getInputStream
in interface Part
- Specified by:
getInputStream
in class AbstractPart
- Returns:
- Get the part data as an input stream
- Throws:
java.io.IOException
javax.mail.MessagingException
getSize
public long getSize()
throws javax.mail.MessagingException
- Specified by:
getSize
in interface Part
- Specified by:
getSize
in class AbstractPart
- Returns:
- size
- Throws:
javax.mail.MessagingException