Concatenate Byte Arrays - CSharp System

CSharp examples for System:Byte Array

Description

Concatenate Byte Arrays

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;// ww  w.j  a va2s  . c  o  m

public class Main{
        public static byte[] ConcatenateByteArrays(byte[] inputArrayOne, byte[] inputArrayTwo)
        {
            byte[] result = new byte[inputArrayOne.Length + inputArrayTwo.Length];
            Array.Copy(inputArrayOne, 0, result, 0, inputArrayOne.Length);
            Array.Copy(inputArrayTwo, 0, result, inputArrayOne.Length, inputArrayTwo.Length);
            return result;
        }
}

Related Tutorials