Re: Overlap between StreamReader and FileReader

On Wed, Jul 17, 2013 at 11:46 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
> On Wed, Jul 17, 2013 at 11:05 AM, Jonas Sicking <jonas@sicking.cc> wrote:
>> What do you mean by "such features"? Are you saying that a Stream zip
>> decompressor should be responsible for both decompressing as well as
>> binary->text conversion? And thus output something other than a
>> Stream?
>
> I meant that for specialized processing you'd likely want more than
> just decoding. You mentioned HTML parsing which requires a fair amount
> more.

I don't think you want a HTML parser to do both decoding and parsing.
That would result in a lot of code duplication in each component that
are dealing with textual formats.

> And if it's just decoding, we could extend
> TextEncoder/TextDecoder to work with Stream objects.

Sure, we can do that. The question is, what is the output from the
TextDecoder if you pass it a Stream? A new TextStream type? Is that
really better than adding the text-consuming functions to Stream?

/ Jonas

Received on Wednesday, 17 July 2013 22:23:10 UTC