private void writeStoreFileChunkToDisk(FileCopyGetChunkResponse chunkResponse, String filePath,
      PartitionFileStore fileStore) {
    validateIfStoreFileCopyHandlerIsRunning();
    StoreFileChunk chunkToWrite;
    try {
      chunkToWrite = new StoreFileChunk(chunkResponse.getChunkStream(), chunkResponse.getChunkStream().available());
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    try {
      fileStore.writeStoreFileChunkToDisk(filePath, chunkToWrite);
    } catch (IOException e) {
      logMessageAndThrow("WriteChunkOperation", "Error writing file chunk to disk", e,
          FileCopyHandlerException.FileCopyHandlerErrorCode.FileCopyHandlerWriteToDiskError);
    }
  }
Write the store file chunk to disk.
@param chunkResponse the chunk response of type {@link FileCopyGetChunkResponse}
@param filePath the file path to write to
@param fileStore the file store to write to
ambry-file-transfer/src/main/java/com/github/ambry/filetransfer/handler/StoreFileCopyHandler.java