Byte array Concat - CSharp System

CSharp examples for System:Byte Array

Description

Byte array Concat

Demo Code


using System.Text.RegularExpressions;
using System.Collections.Specialized;
using System.Threading;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;/*from   w w w  . j  av  a  2  s  .c om*/
using System;
using System.Collections;
using UnityEngine;

public class Main{
        public static byte[] ByteConcat(byte[] left, byte[] right)
        {
            if (null == left)
            {
                return right;
            }

            if (null == right)
            {
                return left;
            }

            byte[] newBytes = new byte[left.Length + right.Length];
            left.CopyTo(newBytes, 0);
            right.CopyTo(newBytes, left.Length);

            return newBytes;
        }
}

Related Tutorials