Files
UnrealEngine/Engine/Source/Programs/UnrealCloudDDC/Jupiter.Common/Utils/TaskUtils.cs
Brandyn / Techy fcc1b09210 init
2026-04-04 15:40:51 -05:00

31 lines
602 B
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
namespace Jupiter
{
public static class TaskUtils
{
public static byte[] CombineIntoSingleBuffer(List<byte[]> tasks)
{
if (tasks.Count == 1)
{
return tasks[0];
}
int totalLength = tasks.Sum(task => task.Length);
byte[] buffer = new byte[totalLength];
int index = 0;
foreach (byte[] partialObject in tasks)
{
Array.Copy(partialObject, 0, buffer, index, partialObject.Length);
index += partialObject.Length;
}
return buffer;
}
}
}