473,395 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Trouble converting arraylist of bytes to a byte array

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
1 9886
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Luk Vloemans | last post by:
Hey, I'm currently working on a project to get GPS-data onto a PDA. At this stage, I'm already getting data from the device, but my problem is: It's rubbish. At least, it looks as if it were...
4
by: Svetoslav Vasilev | last post by:
Hi, I experience some troubles trying to convert an object,returned by a DataTable for a field value to its actual representation of Byte. The field values in a DataTable as we all know are returned...
3
by: Max Gattringer | last post by:
I have written a little programm, which converts normal Text into Unicode Bytes - nothing special, but i tried to creat 2nd Encoder which converts strings(numbers) in a textBox (strings which i...
2
by: crater | last post by:
I need to convert a String to a Byte array and vice versa. Can someone nudge me in the right direction please?
2
by: Shreddy | last post by:
Hi, I'm trying (or struggling) to convert some C code to C#. The existing C client is sending a structure via a TCP socket to a network server. The structure contains a mix of int and char...
8
by: tbh | last post by:
for historical reasons i need to be able to call, from C# under DotNet 2, as COM+ DLL function that returns a "string" which is really an array of seemingly arbitrary bytes (presumably non-zero)....
2
by: Bjorn Sagbakken | last post by:
Hi. This story is about uploading jpg's, then resize them to fixed width or height and storing them to an SQL table. The only way I have found so far is to read the uploaded file to an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.