-
- All Known Implementing Classes:
FileData
,MemoryData
interface Data
-
-
Method Summary
All Methods Instance Methods Abstract 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
-
-
-
Method Detail
-
size
int size()
size of the chunk given by the parser- Returns:
- size of the chunk
-
read
byte[] read()
TODO: should the return type be ByteBuffer ?? Return part's partial data. The data is read only.- Returns:
- a byte array which contains {#size()} bytes. The returned array may be larger than {#size()} bytes and contains data from offset 0.
-
writeTo
long writeTo(DataFile file)
Write this partial data to a file- Parameters:
file
- to which the data needs to be written- Returns:
- file pointer before the write operation(at which the data is written from)
-
-