- From: Domenic Denicola <domenic@domenicdenicola.com>
- Date: Wed, 31 Jul 2013 16:03:53 +0000
- To: Anne van Kesteren <annevk@annevk.nl>, Jonas Sicking <jonas@sicking.cc>
- CC: Takeshi Yoshino <tyoshino@google.com>, Feras Moussa <feras.moussa@hotmail.com>, Travis Leithead <travis.leithead@microsoft.com>, Alex Russell <slightlyoff@google.com>, "Web Applications Working Group WG (public-webapps@w3.org)" <public-webapps@w3.org>, "i@izs.me" <i@izs.me>
From: Anne van Kesteren [annevk@annevk.nl] > 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. I believe this is somewhat similar to how Node streams have settled. Their API is that you call `stream.setEncoding('utf-8')` and then calling `.read(n)` will return a string of at most n characters. By default, there is no encoding set, and calling `.read(n)` will return n bytes in a buffer. In this way, the encoding is a stateful aspect of the stream itself. I don't think there's a way to get around this, without ending up with dangling half-character bytes hanging around.
Received on Wednesday, 31 July 2013 16:04:24 UTC