Re: Overlap between StreamReader and FileReader

On Mon, Jul 29, 2013 at 1:16 PM, Jonas Sicking <jonas@sicking.cc> wrote:
> Couldn't we simply let the Stream class have a content type, which
> could contain an encoding. Then when stream.readText is called, if
> there's an explicit encoding, it would use that encoding when
> converting to text.

How about we use what XMLHttpRequest and WebSocket have?

Stream.prototype.readType takes an enumerated string value which is
"arraybuffer" (default) or "text".

Stream.prototype.read returns a promise fulfilled with the type of
value requested.


-- 
http://annevankesteren.nl/

Received on Monday, 29 July 2013 22:21:21 UTC