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
 
Back
Top