Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

267
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!