On Mon, Jul 29, 2013 at 1:16 PM, Jonas Sicking <jo...@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/