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

Converting Byte() to String

P: n/a
Hi, what is the most performing way to convert a byte stream to a string?

Byte() to be converted to String.

Thanks, iBen.

Sorry if it ia a double post in this newsgroup, I cannot set my first one.
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Benoit,
Hi, what is the most performing way to convert a byte stream to a string? By a 'byte stream' do you mean a class derived from System.IO.Stream?

Use a System.IO.StreamReader class over the Stream object with the correct
encoding passed to the constructor
Byte() to be converted to String. Or are you referring to a Byte Array?

You can use the System.Text.Encoding class to convert an array of Bytes to a
String based on the encoding used in the byte array.

Dim bytes() As Byte
Dim s As String = System.Text.Encoding.Default.GetString(bytes)

Will convert the array of bytes based on the system's current ANSI code
page.
Hope this helps
Jay

"Benoit" <be*************@disfc.com> wrote in message
news:e$**************@TK2MSFTNGP11.phx.gbl... Hi, what is the most performing way to convert a byte stream to a string?

Byte() to be converted to String.

Thanks, iBen.

Sorry if it ia a double post in this newsgroup, I cannot set my first one.

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.