public interface Chunker extends Closeable
chunks are allocated
explicitly and are passed into #nextChunk(Chunk) to be filled/assigned with data representing
next chunk from the stream. This design allows for efficient reuse of chunks when there are multiple concurrent
processors, each processing chunks of data.| Modifier and Type | Method and Description |
|---|---|
Source.Chunk |
newChunk() |
boolean |
nextChunk(Source.Chunk chunk)
Fills a previously
allocated chunk with data to be processed after completion
of this call. |
long |
position() |
Source.Chunk newChunk()
Source.Chunk which is to be later passed into #nextChunk(Chunk)
to fill it with data. When a Source.Chunk has been fully processed then it can be passed into
#nextChunk(Chunk) again to get more data.boolean nextChunk(Source.Chunk chunk) throws IOException
allocated chunk with data to be processed after completion
of this call.chunk - Source.Chunk to fill with data.true if at least some amount of data was passed into the given Source.Chunk,
otherwise false denoting the end of the stream.IOException - on I/O error.long position()
#nextChunk(Chunk).Copyright © 2016–2021 MWARE SOLUTIONS. All rights reserved.