24 lines
No EOL
551 B
C#
24 lines
No EOL
551 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace FrostFS.SDK.Cryptography;
|
|
|
|
internal static class ArrayHelper
|
|
{
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static byte[] Concat(params byte[][] buffers)
|
|
{
|
|
var length = buffers.Sum(buffer => buffer.Length);
|
|
|
|
var dst = new byte[length];
|
|
var p = 0;
|
|
foreach (var src in buffers)
|
|
{
|
|
Buffer.BlockCopy(src, 0, dst, p, src.Length);
|
|
p += src.Length;
|
|
}
|
|
|
|
return dst;
|
|
}
|
|
} |