Is it possible to switch to C# 3.0? If so, use ToArray method, if not, go with good old "create an array, copy values in foreach loop" approach
–
DypplMay 25 '11 at 3:38

2

@Dyppl: ToArray is available for List<> in 2.0. Switching to 3.0 for this isn't necessary. Besides, one would not switch frameworks for a single convenience feature.
–
Paul SasikMay 25 '11 at 3:41

@Paul Sasik: you're right, I totally forgot about that and was sure that people refer to the LINQ extension method. Thanks!
–
DypplMay 25 '11 at 4:02

1

Remember that List and IList have different methods and IList does not have ToArray()...
–
RandomMay 25 '11 at 4:44

2

Personally, for working with binary data I would suggest MemoryStream over List<byte>. Then you can use GetBuffer() to access the oversized backing-buffer without an additional allocation; you just need to remember to only read .Length bytes from it ;p
–
Marc Gravell♦May 25 '11 at 6:11