Package org.jvnet.mimepull
Class FileData
- java.lang.Object
-
- org.jvnet.mimepull.FileData
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Data
createNext(DataHead dataHead, java.nio.ByteBuffer buf)
Factory method to create a Data.byte[]
read()
TODO: should the return type be ByteBuffer ?? Return part's partial data.int
size()
size of the chunk given by the parserlong
writeTo(DataFile file)
Write this partial data to a file
-
-
-
Field Detail
-
file
private final DataFile file
-
pointer
private final long pointer
-
length
private final int length
-
-
Method Detail
-
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
public long writeTo(DataFile file)
Description copied from interface:Data
Write this partial data to a file
-
size
public int size()
Description copied from interface:Data
size of the chunk given by the parser
-
createNext
public Data createNext(DataHead dataHead, java.nio.ByteBuffer buf)
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
-
-