java.lang.Object
org.jvnet.mimepull.MemoryData
- All Implemented Interfaces:
Data
Keeps the Part's partial content data in memory.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MIMEConfig
private final byte[]
private static final boolean
private final int
private static final Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateNext
(DataHead dataHead, ByteBuffer buf) Factory method to create a Data.private static File
createTempFile
(String prefix, String suffix, File dir) byte[]
read()
TODO: should the return type be ByteBuffer ?? Return part's partial data.int
size()
size of the chunk given by the parserlong
Write this partial data to a file
-
Field Details
-
LOGGER
-
data
private final byte[] data -
len
private final int len -
config
-
DELETE_ON_EXIT
private static final boolean DELETE_ON_EXIT
-
-
Constructor Details
-
MemoryData
MemoryData(ByteBuffer buf, MIMEConfig config)
-
-
Method Details
-
size
public int size()Description copied from interface:Data
size of the chunk given by the parser -
read
public byte[] read()Description copied from interface:Data
TODO: should the return type be ByteBuffer ?? Return part's partial data. The data is read only. -
writeTo
Description copied from interface:Data
Write this partial data to a file -
createNext
Description copied from interface:Data
Factory method to create a Data. The implementation could be file based one or memory based one.- Specified by:
createNext
in interfaceData
- Parameters:
dataHead
- start of the linked list of data objectsbuf
- contains partial content for a part- Returns:
- Data
-
createTempFile
- Throws:
IOException
-