private FileCopyGetChunkResponse getFileCopyGetChunkResponse(File logSegmentFile, int offset, int chunkSize) {
    try (RandomAccessFile randomAccessFile = new RandomAccessFile(logSegmentFile, "r")) {
      randomAccessFile.seek(offset);
      ByteBuffer buf = ByteBuffer.allocate(chunkSize);

      while (buf.hasRemaining()) {
        int bytesRead = randomAccessFile.getChannel().read(buf);
        if (bytesRead == -1) {
          break; // EOF reached
        }
      }
      // Prepare buffer for reading
      buf.flip();

      return new FileCopyGetChunkResponse(
          FileCopyGetChunkResponse.FILE_COPY_CHUNK_RESPONSE_VERSION_V_1, 0, "clientId",
          ServerErrorCode.NoError, fileCopyInfo.getTargetReplicaId().getPartitionId(), logSegmentFile.getName(),
          new DataInputStream(new ByteBufferInputStream(buf)), offset, chunkSize, false);
    } catch (Exception e){
      throw new RuntimeException(e);
    }
  }
For the given log segment file, offset and chunkSize, this method creates a {@link FileCopyGetChunkResponse} object
with the chunk data read from the file.
ambry-file-transfer/src/test/java/com/github/ambry/filetransfer/handler/StoreFileCopyHandlerIntegTest.java