469,623 Members | 899 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

Converting Byte() to String

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
1 9335
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.

Similar topics

5 posts views Thread by matt melton | last post: by
4 posts views Thread by Hal Vaughan | last post: by
4 posts views Thread by Prabhu | last post: by
8 posts views Thread by Marius Cabas | last post: by
16 posts views Thread by manmit.walia | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.