public ByteBuffer getNextChunk() throws InterruptedException {
    ByteBuffer chunkBuf = null;
    if (isOpen()) {
      chunkBuf = getChunkBuffer(chunks.take());
    }
    return chunkBuf;
  }
Gets the next chunk of data as a {@link ByteBuffer} when it is available.
<p/>
If the channel is not closed, this function blocks until the next chunk is available. Once the channel is closed,
this function starts returning {@code null}.
@return a {@link ByteBuffer} representing the next chunk of data if the channel is not closed. {@code null} if the
        channel is closed.
@throws InterruptedException if the wait for a chunk is interrupted.
ambry-test-utils/src/main/java/com/github/ambry/router/ByteBufferAWC.java