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
  • 34,042
  • 79
  • 253
  • 454

1 Answers1

17

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,701
  • 14
  • 61
  • 104