How to split byte array into n smaller byte arrays in c#

I have this Byte[] array that has 10 elements i.e {10, 10, 10, 10, 10, 10, 10, 10, 10, 10} and I need to split the array into 5 different Byte[] arrays each containing 2 elements.

I am just using 5 as an example but sometimes the array can have 12 elements which will subsequently need to be split into 6 smaller arrays that contain 2elements and so forth.

What is the most effective way to achieve this?



Read more here: https://stackoverflow.com/questions/66281335/how-to-split-byte-array-into-n-smaller-byte-arrays-in-c-sharp

Content Attribution

This content was originally published by Harold_Finch at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: