Converting a string to a stream?

D

David

I'm trying to convert this code: http://www.123aspx.com/redir.aspx?res=35884
to Visual Basic.

I have just about everything except for the "Stream2String" function that is
found at the end of both decompression functions.

I googled for "Stream2String" and didn't find too much at all. I've googled
for "convert stream to string visual basic" and haven't found much either.

Recommendations on how to handle this part of the code would be appreciated.

Thanks,

David
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

David said:
I'm trying to convert this code: http://www.123aspx.com/redir.aspx?res=35884
to Visual Basic.

I have just about everything except for the "Stream2String" function that is
found at the end of both decompression functions.

I googled for "Stream2String" and didn't find too much at all. I've googled
for "convert stream to string visual basic" and haven't found much either.

Recommendations on how to handle this part of the code would be appreciated.

Thanks,

David

Read the bytes from the stream and use the Encoding.GetString() method
to decode the bytes into a string. Use the specific encoding object for
the way that the string was encoded into bytes, for example
UTF8.GetString().
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

On second thought, it might be easier to create a StreamReader object
where you specify the encoding, and use the ReadToEnd method to get the
string.
 

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

Top