Given byte[] buffer
I'd like to create a new array from a sub-array. A method signature might look like byte[] SubArray(byte[] buffer, int start, int length)
but I'd probably rather just have a neat 1-liner than a method.
Here's a nice neat LINQ version but it feels like this mightn't be very efficient. Is there a standard library method that does this or would I have to create a new array then copy to it?
var subArray = buffer.Skip(start).Take(length).ToArray();