protected ByteBuf filterChunkToRange(ByteBuf buf) {
      if (options.getBlobOptions.getRange() == null) {
        return buf;
      }
      if (resolvedByteRange.getRangeSize() == 0) {
        buf.clear();
      } else {
        long relativeOffset = offset;
        if (options.getBlobOptions.hasBlobSegmentIdx()) {
          relativeOffset = 0;
        }
        long startOffsetInThisChunk = chunkIndex == 0 ? resolvedByteRange.getStartOffset() - relativeOffset : 0;
        long endOffsetInThisChunkExclusive =
            chunkIndex == (numChunksTotal - 1) ? resolvedByteRange.getEndOffset() - relativeOffset + 1 : chunkSize;
        buf.setIndex(buf.readerIndex() + (int) startOffsetInThisChunk,
            buf.readerIndex() + (int) endOffsetInThisChunkExclusive);
      }
      return buf;
    }
Slice this chunk's data to only include the bytes within the operation's specified byte range.
@param buf the {@link ByteBuf} representing the content of this chunk.
@return A {@link ByteBuf} that only includes bytes within the operation's specified byte range.
ambry-router/src/main/java/com/github/ambry/router/GetBlobOperation.java