Is there are an easy way to initialize byte array from portion of existing byte array. In C language it is possible to use pointer to say like
char s[10] = new char[10];
char* b = s + 5;
Is it possible to do that in c#, like:
byte[] b = new byte[buffersize];
byte* header = b + 5;
byte* data = b + 25;
The ArraySegment<T> structure provides a view of an array without creating a copy. It cannot be used in places where a byte array is expected, though.
If you need a byte array, you need to copy the desired values to a new array instance, preferably using Buffer.BlockCopy: