Today I wanna ask a question about js fetch api:
I received stream of bytes(Java call on strings toByteArray and send it to outputstream as binary data).
I wanna catch it by chunks and decode as soon as possible and attach to htmlin browser.
I used javascript fetch api and decode every chunk by textDecoder. But how js recognize that character is ended and not splitted beetwen chunks?
So problem here is a really poor docs about fetch api. What chunk really is? How fetch decide where chunk is stopped and give it to me to process? Is it possible that I receive a part of character in one chunk, so decode will fail?
I tried it with some text and it seems to decode properly, but I can't be sure without knowledge of it.
Java default utf8 encode.