Danny
10/15/2003 10:56:00 PM
ASCIIEncoding.GetString() worked.
Thanks Ali & Girish!
Cheers.
-Danny-
"Ali Mazaheri, MCAD" <mcad@vb.net> wrote in message
news:OPV9zt2kDHA.2364@TK2MSFTNGP11.phx.gbl...
> As Girish Mentioned you can leverage system.encoding classes for that
> purpose.
>
> "Girish Bharadwaj" <girishb@nowhere> wrote in message
> news:3F8DB3BA.50106@nowhere...
> > ASCIIEncoding.GetString().. might be able to help you out.
> >
> > Danny wrote:
> > > Thanks Ali.
> > >
> > > BitConverter returns a string with hexadecimal pairs (that correspond
to
> > > each byte in the array). How do I get a regular string? I am trying to
> > > serialize XML into a string and I want to avoid writing the XML to a
> file
> > > first. I am using a MemoryStream (I need to use a MemoryStream via
> > > XmlTextWriter in order to change the default encoding) and calling
> Serialize
> > > (off XmlSerializer) to that stream. I then want to get a string from
the
> > > stream return it to the caller.
> > >
> > > Thanks!
> > >
> > > -Danny-
> > >
> > > "Ali Mazaheri,MCAD" <mcad@vb.net> wrote in message
> > > news:epqTBFukDHA.3612@TK2MSFTNGP11.phx.gbl...
> > >
> > >>bitconverter.tostring(memorystream.toarray)
> > >>
> > >>"Danny" <industrial_disease@hotmail.com> wrote in message
> > >>news:eQ33kyskDHA.2328@TK2MSFTNGP10.phx.gbl...
> > >>
> > >>>Hi.
> > >>>
> > >>>What is the fastest way to convert a memory stream (containing a byte
> > >
> > > [])
> > >
> > >>to
> > >>
> > >>>a string?
> > >>>
> > >>>Thanks.
> > >>>
> > >>>-Danny-
> > >>>
> > >>>
> > >>
> > >>
> > >
> > >
> >
> >
> > --
> > Girish Bharadwaj
> >
>
>