Problem with byte array....

S

sridev

hi all,


i have a byte array which has length of 10,000.I have to break this
byte array into smaller parts of length 512 and save this values into
another byte array.

I am doing this because i want to send the large byte array thro' the
socket connection.Plz help me....with example ...


with regards
sridev
 
J

Jon Skeet [C# MVP]

sridev said:
i have a byte array which has length of 10,000.I have to break this
byte array into smaller parts of length 512 and save this values into
another byte array.

I am doing this because i want to send the large byte array thro' the
socket connection.Plz help me....with example ...

You can do this without breaking the byte array up yourself (unless
it's as UDP, I believe) - the framework will do it for you.

If you *really* need to, however, create individual arrays and use
Array.Copy or Buffer.BlockCopy to copy the contents.

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top