[server] Write buffer concatenation method
This commit is contained in:
parent
77f2c1c8c3
commit
d1daadef29
1 changed files with 14 additions and 0 deletions
|
@ -32,6 +32,20 @@ namespace SBRL.Utilities
|
||||||
["\n"] = @"\n",
|
["\n"] = @"\n",
|
||||||
["\t"] = @"\t"
|
["\t"] = @"\t"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Concatenates a pair of buffers into a single long buffer.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="A">The first buffer to concatenate.</param>
|
||||||
|
/// <param name="B">The second buffer to concatenate.</param>
|
||||||
|
/// <returns>The concatenated buffers.</returns>
|
||||||
|
public static byte[] ConcatBuffers(byte[] A, byte[] B)
|
||||||
|
{
|
||||||
|
byte[] result = new byte[A.Length + B.Length];
|
||||||
|
Buffer.BlockCopy(A, 0, result, 0, A.Length);
|
||||||
|
Buffer.BlockCopy(B, 0, result, A.Length, B.Length);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue