Re: Reading & Writing in a Stream
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 03/07/04
- Next message: C-Sharper or C-Hasher, one of the two: "Center one form over another + height of title bar"
- Previous message: Sujala: "Re: private static void Main()"
- In reply to: Cor: "Re: Reading & Writing in a Stream"
- Next in thread: Cor: "Re: Reading & Writing in a Stream"
- Reply: Cor: "Re: Reading & Writing in a Stream"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 7 Mar 2004 17:17:58 -0000
Cor <non@non.com> wrote:
> A newsgroup keep the messages open this is what you tell that is the
> question from the OP
> > The OP wants to know how to write data to a *stream*, so he can't do it
> > as strings - not without a StreamWriter or manually calling
> > Encoding.GetBytes etc.
> >
>
> This is the question from the OP (copied from his message)
> I want to write (or read) to a stream, but the data is not byte array.
> I converted the data to byte array manually, but it is very slow, (becuse
> the data is very large).
> Is another way for this kind of writing and reading?
> ---------------------------------------------------------
> I do not know if he means to mem. to http or to disk. Therefore I gave the
> answer that if it is to disk, it is not necessary to make first that
> bytearray.
Why though? How would you do things differently if it's writing to a
disk compared with writing anywhere else?
> I did not tell how, that could be done when he had asked for that or maybe
> he had answered that it was not to disk and than I had given another answer.
Well, you said you could write strings directly using a stream, which
you can't - you need to wrap it with a StreamWriter first, and that's
true whether the stream is to memory, the network or wherever.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: C-Sharper or C-Hasher, one of the two: "Center one form over another + height of title bar"
- Previous message: Sujala: "Re: private static void Main()"
- In reply to: Cor: "Re: Reading & Writing in a Stream"
- Next in thread: Cor: "Re: Reading & Writing in a Stream"
- Reply: Cor: "Re: Reading & Writing in a Stream"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|