public class ByteArrayAttachment extends SerialisableAttachment
SerialisableAttachment having plain byte[]
content.| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
bytes
The content represented as
byte[]. |
contentType, description, inlineName, name| Constructor and Description |
|---|
ByteArrayAttachment(java.lang.String name,
java.lang.String description,
byte[] bytes)
Creates an attachment having the designated name, description and content.
|
ByteArrayAttachment(java.lang.String name,
java.lang.String description,
byte[] bytes,
boolean inline)
Creates an attachment having the designated name, description and content.
|
ByteArrayAttachment(java.lang.String name,
java.lang.String description,
byte[] bytes,
java.lang.String inlineName)
Creates an attachment having the designated name, description and content.
|
ByteArrayAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
byte[] bytes)
Creates an attachment having the designated name, description, content
type (MIME) and content.
|
ByteArrayAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
byte[] bytes,
boolean inline)
Creates an attachment having the designated name, description, content type (MIME) and content.
|
ByteArrayAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
byte[] bytes,
java.lang.String inlineName)
Creates an attachment having the designated name, description, content type (MIME) and content.
|
ByteArrayAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
java.io.InputStream content,
java.lang.String inlineName)
Creates an attachment having the designated name, description, content type (MIME) and content
retrieved from the designated string.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getContent()
Gets the content of the attachment represented as
InputStream. |
getContentType, getDescription, getInlineName, getNamepublic ByteArrayAttachment(java.lang.String name,
java.lang.String description,
byte[] bytes)
name - The name of the attachment.description - The description of the attachment.bytes - The content of the attachment represented as
byte[].public ByteArrayAttachment(java.lang.String name,
java.lang.String description,
byte[] bytes,
boolean inline)
name - The name of the attachment.description - The description of the attachment.bytes - The content of the attachment represented as byte[].inline - Whether to inline this attachment in case of an HTML message using the designated
name.public ByteArrayAttachment(java.lang.String name,
java.lang.String description,
byte[] bytes,
java.lang.String inlineName)
name - The name of the attachment.description - The description of the attachment.bytes - The content of the attachment represented as byte[].inlineName - The name used in the corresponding HTML message to refer to this attachment
to be inlined. Use null to not inline the attachment.public ByteArrayAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
byte[] bytes)
name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) of the attachment.bytes - The content of the attachment represented as
byte[].public ByteArrayAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
byte[] bytes,
boolean inline)
name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) of the attachment.bytes - The content of the attachment represented as byte[].inline - Whether to inline this attachment in case of an HTML message using the designated
name.public ByteArrayAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
byte[] bytes,
java.lang.String inlineName)
name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) of the attachment.bytes - The content of the attachment represented as byte[].inlineName - The name used in the corresponding HTML message to refer to this attachment
to be inlined. Use null to not inline the attachment.public ByteArrayAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
java.io.InputStream content,
java.lang.String inlineName)
throws java.io.IOException
name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) of the attachment.content - The content of the attachment represented as InputStream.inlineName - The name used in the corresponding HTML message to refer to this attachment
to be inlined. Use null to not inline the attachment.java.io.IOException - If there is a problem reading the content from the designated stream, an
IOException will be thrown.public java.io.InputStream getContent()
SerialisableAttachmentInputStream. InputStream cannot be serialised.getContent in class SerialisableAttachment