org.apache.axiom.attachments.impl
Class PartOnMemory
java.lang.Object
org.apache.axiom.attachments.impl.AbstractPart
org.apache.axiom.attachments.impl.PartOnMemory
- All Implemented Interfaces:
- Part
public class PartOnMemory
- extends AbstractPart
PartOnMemory stores the attachment in memory (in a byte[])
This implementation is used for smaller attachments to enhance
performance.
The PartOnMemory object is created by the PartFactory
- See Also:
org.apache.axiom.attachments.impl.PartFactory.
Field Summary |
(package private) byte[] |
bytes
|
(package private) int |
length
|
private static org.apache.commons.logging.Log |
log
|
Constructor Summary |
PartOnMemory(java.util.Hashtable headers,
byte[] bytes,
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
bytes
byte[] bytes
length
int length
PartOnMemory
PartOnMemory(java.util.Hashtable headers,
byte[] bytes,
int length)
- Construct a PartOnMemory
- Parameters:
headers
- bytes
- 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