| java.lang.Object org.jvnet.mimepull.DataHead
DataHead | final class DataHead (Code) | | Represents an attachment part in a MIME message. MIME message parsing is done
lazily using a pull parser, so the part may not have all the data.
DataHead.read and
DataHead.readOnce may trigger the actual parsing the message. In fact,
parsing of an attachment part may be triggered by calling
DataHead.read methods
on some other attachemnt parts. All this happens behind the scenes so the
application developer need not worry about these details.
author: Jitendra Kotamraju |
Inner Class :final class ReadOnceStream extends ReadMultiStream | |
dataFile | DataFile dataFile(Code) | | If the part is stored in a file, non-null.
If head is non-null, then we have the whole part in the file,
otherwise the file is only partial.
|
headtail | volatile Chunk headtail(Code) | | Linked list to keep the part's content
|
inMemory | volatile long inMemory(Code) | | |
readOnce | boolean readOnce(Code) | | |
addBody | void addBody(ByteBuffer buf)(Code) | | |
doneParsing | void doneParsing()(Code) | | |
read | public InputStream read()(Code) | | Can get the attachment part's content multiple times. That means
the full content needs to be there in memory or on the file system.
Calling this method would trigger parsing for the part's data. So
do not call this unless it is required(otherwise, just wrap MIMEPart
into a object that returns InputStream for e.g DataHandler)
data for the part's content |
readOnce | public InputStream readOnce()(Code) | | Can get the attachment part's content only once. The content
will be lost after the method. Content data is not be stored
on the file system or is not kept in the memory for the
following case:
- Attachement parts contents are accessed sequentially
In general, take advantage of this when the data is used only
once.
data for the part's content |
|
|