Remove Last X Bytes - CSharp System

CSharp examples for System:Byte Array

Description

Remove Last X Bytes

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;// w ww.  ja  va 2 s  . c om

public class Main{
        public static byte[] RemoveLastXBytes(byte[] inputArray, int amountOfBytes)
        {
            byte[] result = new byte[inputArray.Length - amountOfBytes];
            Array.Copy(inputArray, 0, result, 0, inputArray.Length - amountOfBytes);
            return result;
        }
}

Related Tutorials