public class InMemoryAttachment extends java.lang.Object implements Attachment, java.io.Serializable
| Constructor and Description |
|---|
InMemoryAttachment(java.lang.String name,
byte[] content)
create instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
called to denote that this attachment is not needed anymore and used resources can be released.
|
byte[] |
getAsBytes()
get attachment content as a byte array.
|
byte[] |
getAsBytes(int length)
get start of attachment content as byte[].
|
java.io.InputStream |
getAsStream()
get attachment content for streaming.
|
java.lang.String |
getName() |
long |
size()
get size of attachments.
|
java.lang.String |
toString() |
public InMemoryAttachment(java.lang.String name,
byte[] content)
public java.lang.String getName()
getName in interface Attachmentpublic long size()
Attachmentsize in interface Attachmentpublic byte[] getAsBytes()
AttachmentgetAsBytes in interface Attachmentpublic byte[] getAsBytes(int length)
AttachmentgetAsBytes in interface Attachmentpublic java.io.InputStream getAsStream()
AttachmentgetAsStream in interface Attachmentpublic void dispose()
Attachmentdispose in interface Attachmentpublic java.lang.String toString()
toString in class java.lang.Object