Interface IChunkSupplier


public interface IChunkSupplier
A chunk supplier.
  • Method Summary

    Modifier and Type
    Method
    Description
    Supplies the next chunk.
    void
    Recycles the given chunk.
  • Method Details

    • nextChunk

      ByteBuffer nextChunk() throws IOException
      Supplies the next chunk. The returned chunk must be recycled before the next one is requested. If an invocation of this method returned null, all subsequent invocations will return null. 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

      void recycleChunk(ByteBuffer chunk) throws IOException
      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 be null
      Throws:
      IOException - if an IO error occurs