Append Byte To Array - CSharp System

CSharp examples for System:Byte Array

Description

Append Byte To Array

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from  w w w  .j av a  2  s  . c  o m

public class Main{
        public static byte[] AppendByteToArray(byte[] inputArray, byte inputByte)
        {
            byte[] result = new byte[inputArray.Length + 1];
            Array.Copy(inputArray, 0, result, 0, inputArray.Length);
            result[result.Length - 1] = inputByte;
            return result;
        }
}

Related Tutorials