11

Possible Duplicate:
How to copy part of an array to another array in C#

c# - how to copy a section of "byte[]" variable to another array?

Community
  • 1
  • 1
Greg
  • 33,110
  • 77
  • 244
  • 440

1 Answers1

16

how about something like:

var byteArray = new byte[] { 1, 0, 1 };
var startIndex = 1;
var length = 2;

byteArray.Skip(startIndex).Take(length).ToArray();
theburningmonk
  • 15,283
  • 13
  • 58
  • 103