Trouble converting arraylist of bytes to a byte array

  • Thread starter Thread starter James Dean
  • Start date Start date
J

James Dean

i cannot convert my arraylist of bytes to a byte array what could be the
problem.
i tried the following but it did not work:
byte[] bytearray =
(byte[])tempbitarray.ToArray(tempbitarray[0].GetType());

Also i was wondering is it possible to convert a bitarray to a
bytearray.
 
Hi James,
i cannot convert my arraylist of bytes to a byte array what could be the
problem.
i tried the following but it did not work:
byte[] bytearray =
(byte[])tempbitarray.ToArray(tempbitarray[0].GetType());

Also i was wondering is it possible to convert a bitarray to a
bytearray.

Use CopyTo(...) method of ArrayList, it works on 100%!

Cheers!

Marcin
 

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