class PartContentOnMemory extends PartContent
PartContentFactory| Modifier and Type | Field and Description |
|---|---|
private java.util.ArrayList |
data |
private int |
length |
| Constructor and Description |
|---|
PartContentOnMemory(java.util.ArrayList data,
int length)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
destroy()
Release all resources used to store the content of the MIME part.
|
(package private) javax.activation.DataSource |
getDataSource(java.lang.String contentType)
Get a
DataSource implementation specific for this buffering strategy, if supported. |
(package private) java.io.InputStream |
getInputStream()
Get an
InputStream representing the buffered MIME part content. |
(package private) long |
getSize()
Get the size of the MIME part, more precisely the number of bytes in the decoded content of
the MIME part.
|
(package private) void |
writeTo(java.io.OutputStream os)
Write the buffered MIME part content to the given output stream.
|
PartContentOnMemory(java.util.ArrayList data,
int length)
data - a list of 4K byte arrayslength - the total length of the data in bytesjava.io.InputStream getInputStream()
PartContentInputStream representing the buffered MIME part content. Note that a new
InputStream object must be returned each time this method is called, and the stream
must be positioned at the beginning of the data.getInputStream in class PartContentjavax.activation.DataSource getDataSource(java.lang.String contentType)
PartContentDataSource implementation specific for this buffering strategy, if supported.
If no DataSource is returned, then a default implementation will be used. If a
DataSource is returned, it should implement SizeAwareDataSource.getDataSource in class PartContentcontentType - the content type for the DataSource, which must be returned by
DataSource.getContentType()DataSource implementation or null if a default
DataSource implementation should be usedvoid writeTo(java.io.OutputStream os)
throws java.io.IOException
PartContentwriteTo in class PartContentos - the output stream to write the content tojava.io.IOException - if an I/O error occurs (either while reading the buffered content or while
writing to the output stream)long getSize()
PartContentgetSize in class PartContentvoid destroy()
throws java.io.IOException
PartContentdestroy in class PartContentjava.io.IOException - if an I/O error occurs