By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,857 Members | 1,816 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,857 IT Pros & Developers. It's quick & easy.

Trouble converting arraylist of bytes to a byte array

P: n/a
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.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.