Skip to content

Instantly share code, notes, and snippets.

@senorincognito
Last active August 18, 2016 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save senorincognito/1e70ea8dc5fe20236966097ebfcbb1ce to your computer and use it in GitHub Desktop.
Save senorincognito/1e70ea8dc5fe20236966097ebfcbb1ce to your computer and use it in GitHub Desktop.
Concatenate two C# byte arrays
public static byte[] ArrayCombine(byte[] arr1, byte[] arr2)
{
var result = new byte[arr1.Length + arr2.Length];
Buffer.BlockCopy(arr1, 0, result, 0, arr1.Length);
Buffer.BlockCopy(arr2, 0, result, arr1.Length, arr2.Length);
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment