Transferring raw binary data into a string

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

How can I transfer raw binary data from a byte[] to a string (or char[])
without encoding the data in any way?
 
Dan said:
How can I transfer raw binary data from a byte[] to a string (or char[])
without encoding the data in any way?

You can't. It's like asking to transfer a number as a colour without
encoding the number at all. The way you convert the byte array to the
string is exactly the encoding in question.

If it's arbitrary binary data, I'd suggest using Base64 - there are
handy methods in the Convert class to help you.
 

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