CSharp examples for System:Byte Array
Skip byte array and get the rest elements
using System.Text; using System;//from ww w .j a va 2 s.com public class Main{ public static byte[] Skip(this byte[] array, int skip) { return array.SkipAndTake(skip, array.Length - skip); } public static byte[] SkipAndTake(this byte[] array, int skip, int take, bool extend = false) { if (!extend && take > array.Length) { take = array.Length; } byte[] result = new byte[take]; if (extend && take > array.Length) { take = array.Length; } if (take == 0) { return result; } if (skip == 0) { Array.Copy(array, result, take); } else { Array.Copy(array, skip, result, 0, take); } return result; } }