- java.lang.Object
-
- org.jvnet.mimepull.MemoryData
-
-
Field Summary
Fields Modifier and Type Field Description private MIMEConfigconfigprivate byte[]dataprivate static booleanDELETE_ON_EXITprivate intlenprivate static java.util.logging.LoggerLOGGER
-
Constructor Summary
Constructors Constructor Description MemoryData(java.nio.ByteBuffer buf, MIMEConfig config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DatacreateNext(DataHead dataHead, java.nio.ByteBuffer buf)Factory method to create a Data.private static java.io.FilecreateTempFile(java.lang.String prefix, java.lang.String suffix, java.io.File dir)byte[]read()TODO: should the return type be ByteBuffer ?? Return part's partial data.intsize()size of the chunk given by the parserlongwriteTo(DataFile file)Write this partial data to a file
-
-
-
Field Detail
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
data
private final byte[] data
-
len
private final int len
-
config
private final MIMEConfig config
-
DELETE_ON_EXIT
private static final boolean DELETE_ON_EXIT
-
-
Constructor Detail
-
MemoryData
MemoryData(java.nio.ByteBuffer buf, MIMEConfig config)
-
-
Method Detail
-
size
public int size()
Description copied from interface:Datasize of the chunk given by the parser
-
read
public byte[] read()
Description copied from interface:DataTODO: should the return type be ByteBuffer ?? Return part's partial data. The data is read only.
-
writeTo
public long writeTo(DataFile file)
Description copied from interface:DataWrite this partial data to a file
-
createNext
public Data createNext(DataHead dataHead, java.nio.ByteBuffer buf)
Description copied from interface:DataFactory method to create a Data. The implementation could be file based one or memory based one.- Specified by:
createNextin interfaceData- Parameters:
dataHead- start of the linked list of data objectsbuf- contains partial content for a part- Returns:
- Data
-
createTempFile
private static java.io.File createTempFile(java.lang.String prefix, java.lang.String suffix, java.io.File dir) throws java.io.IOException- Throws:
java.io.IOException
-
-