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 Attachment
public long size()
Attachment
size
in interface Attachment
public byte[] getAsBytes()
Attachment
getAsBytes
in interface Attachment
public byte[] getAsBytes(int length)
Attachment
getAsBytes
in interface Attachment
public java.io.InputStream getAsStream()
Attachment
getAsStream
in interface Attachment
public void dispose()
Attachment
dispose
in interface Attachment
public java.lang.String toString()
toString
in class java.lang.Object