@Override
  public void writeTo(AsyncWritableChannel channel, Callback<Long> callback) {
    int lastIndex = readOptions.size() - 1;
    int i = 0;
    for (BlobReadOptions options : readOptions) {
      ByteBuffer buf = options.getPrefetchedData().nioBuffer();
      if (buf == null) {
        callback.onCompletion(null, new IllegalStateException("Data should be prefetched."));
      }
      buf.position(0);
      if (i == lastIndex) {
        // only the last one needs callback.
        channel.write(buf, callback);
      } else {
        // TODO: Stop writing to the channel whenever there is an exception and stop the for loop.
        channel.write(buf, null);
      }
      i++;
    }
  }
An implementation of MessageReadSet that maintains a list of
offsets from the underlying file channel
ambry-store/src/main/java/com/github/ambry/store/StoreMessageReadSet.java