If you want to resize, you should use List<byte> instead. Arrays cannot be changed, so you will need to create a completely new array and then copy the old content to the new array before adding additional content (this is what Array.Resize , if that's what you were talking about).
List<T> uses an array internally, but optimizes resizing, so you don't have to deal with it.
In fact, when the internal array is filled and new content is added, List<T> will double the size of the internal array, so resizing should be very rare - if you change the size of the array directly, on the other hand, you will either have to use a similar strategy and save the "counter sizing "or take the cost of resizing for any added content.
source share