Combine two byte array together - CSharp System

CSharp examples for System:Byte Array

Description

Combine two byte array together

Demo Code


using System.Runtime.InteropServices;

public class Main{
        public static byte[] Combine(byte[] first, byte[] second)
        {// www.j a v a 2  s  .c o  m
            byte[] rv = new byte[first.Length + second.Length];
            System.Buffer.BlockCopy(first, 0, rv, 0, first.Length);
            System.Buffer.BlockCopy(second, 0, rv, first.Length, second.Length);
            return rv;
        }
}

Related Tutorials