Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

269
Visualizações
How to decode string from chunk from fetch api properly

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.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda