rust-encoding icon indicating copy to clipboard operation
rust-encoding copied to clipboard

How to Reset a RawDecoder

Open yodalee opened this issue 9 years ago • 1 comments

I'm current working on this issue: https://github.com/servo/servo/issues/13234 To support streaming, I need to use RawDecoder provided by rust-encoding. I add an instance of RawDecoder to TextDecoder, make decode method use interface by RawDecoder. However I found no way to 'reset' the RawDecoder, that is, clear raw decoder's current state and unprocessed buffer. Is that can be done?

yodalee avatar Nov 16 '16 09:11 yodalee

Try RawDecoder::from_self method.

lifthrasiir avatar Nov 17 '16 01:11 lifthrasiir