Interface IChunkSupplier
public interface IChunkSupplier
A chunk supplier.
-
Method Summary
Modifier and TypeMethodDescriptionSupplies the next chunk.void
recycleChunk
(ByteBuffer chunk) Recycles the given chunk.
-
Method Details
-
nextChunk
Supplies the next chunk. The returned chunk must be recycled before the next one is requested. If an invocation of this method returnednull
, all subsequent invocations will returnnull
. The returned buffer's position will be zero, its limit will be its capacity.- Returns:
- the chunk, or
null
if no more chunks are available - Throws:
IOException
- if an IO error occurs
-
recycleChunk
Recycles the given chunk. The chunk must be provided by this supplier. After the chunk is recycled, a new one may be requested.- Parameters:
chunk
- the chunk to recycle, cannot benull
- Throws:
IOException
- if an IO error occurs
-