[whatwg/encoding] What's the correct use of {stream: true} option for Textdecoder.decode (#184)

Just came cross there is a second option can be passed to decoder, My first thought about it is a buffer, so I can do
```javascript
 decoder.decode( new Uint8ArrayBuffer([97, 98, 99]), { stream: true })
```
and append another buffer
```javascript
 decoder.decode( new Uint8ArrayBuffer([100,  101 , 102]), { stream: true })
```
and finally get me a string back which include the 2 parts 
```javascript
 const finalString = decoder.decode( new Uint8ArrayBuffer([]) , { stream: false })
```
but it isn't the case
the first two expression return "abc" and "def" the third give me empty, just like them without the stream option. 

Can anyone can tell me how to use it correctly?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/184

Received on Wednesday, 4 September 2019 04:15:13 UTC