Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

268
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda