Re: Encoding... sigh.
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 02/11/04
- Next message: harry: "Re: Dot Net Limitations"
- Previous message: NoLongerMicah: "re:ArrayList size of elements"
- In reply to: C# Learner: "Re: Encoding... sigh."
- Next in thread: C# Learner: "Re: Encoding... sigh."
- Reply: C# Learner: "Re: Encoding... sigh."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 11 Feb 2004 16:25:39 -0000
C# Learner <csharp@learner.here> wrote:
> >Then just read the content from the stream, and don't try to convert it
> >into a string.
>
> But I need to eventually convert this content into an array of bytes
> (to be sent off to another socket). I really can't have decoding
> happening here. :-(
Then why were you trying to read it into a string? Just read it into an
array of bytes. You can use MemoryStream to make that easier for you -
just read a block at a time, writing the contents of the block to the
MemoryStream, and then call ToArray at the end.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: harry: "Re: Dot Net Limitations"
- Previous message: NoLongerMicah: "re:ArrayList size of elements"
- In reply to: C# Learner: "Re: Encoding... sigh."
- Next in thread: C# Learner: "Re: Encoding... sigh."
- Reply: C# Learner: "Re: Encoding... sigh."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|