C#, how to halve a byte array?

Posted by JL on Stack Overflow See other posts from Stack Overflow or by JL
Published on 2010-03-31T16:15:47Z Indexed on 2010/03/31 16:23 UTC
Read the original article Hit count: 142

Filed under:

I have a byte array defined like this

byte[] fileContents = File.ReadAllBytes(zfoFileName);

How can I get the first 1/2 of the fileContents byte array?

In other words if the upper bound of the array is 10, I would like a new byte array to have the first 5 values of fileContents.

Thanks in advance

© Stack Overflow or respective owner

Related posts about c#