Re: Is there any iterator-like constructs for Streams?
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 06/07/04
- Next message: adnan boz: "Re: Reflection"
- Previous message: Jon Skeet [C# MVP]: "Re: Reflection"
- In reply to: Peter Rilling: "Is there any iterator-like constructs for Streams?"
- Next in thread: Daniel O'Connell [C# MVP]: "Re: Is there any iterator-like constructs for Streams?"
- Reply: Daniel O'Connell [C# MVP]: "Re: Is there any iterator-like constructs for Streams?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 7 Jun 2004 11:42:48 +0100
Peter Rilling <peter@nospam.rilling.net> wrote:
> One nice thing about collections and arrays is that they implement the
> IEnumerator and IEnumerable interfaces which allow for more then one
> iterator to walk the list of items without affecting the position of the
> other iterators. Is there a similar thing with streams? Is there anything
> in the framework that wraps a stream in such a way that the stream position
> is decoupled from the stream itself?
Bear in mind that not every stream is seekable. Once you've read from a
network connection, for instance, you can't go and rewind that. The
stream would have to buffer everything. It's doable, no doubt, but I
don't believe it's provided in the framework.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: adnan boz: "Re: Reflection"
- Previous message: Jon Skeet [C# MVP]: "Re: Reflection"
- In reply to: Peter Rilling: "Is there any iterator-like constructs for Streams?"
- Next in thread: Daniel O'Connell [C# MVP]: "Re: Is there any iterator-like constructs for Streams?"
- Reply: Daniel O'Connell [C# MVP]: "Re: Is there any iterator-like constructs for Streams?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|