problems durring conversion byte[]

  • Thread starter Thread starter user
  • Start date Start date
U

user

Hello
i have:
byte [] b1;
byte [] b2;

i want to copy 5 elements from b1 (starting from index 10)
into b2 (starting from index 0).
How can i do it ? Does .NET have any possibility to do that ?
or i have to use pointers and unsafe ?


Thanx
 
Hello
i have:
byte [] b1;
byte [] b2;

i want to copy 5 elements from b1 (starting from index 10)
into b2 (starting from index 0).
How can i do it ? Does .NET have any possibility to do that ?
or i have to use pointers and unsafe ?

Array.Copy (b1, 10, b2, 0, 5)

(Assuming b2 is already large enough, of course.)
 

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

Back
Top