You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
jsoup bodyStream() silently truncates responses at Integer.MAX_VALUE despite maxBodySize(0) #2593
When using Connection.maxBodySize(0) together with Response.bodyStream() to download a large binary response, the response appears to be silently truncated at exactly Integer.MAX_VALUE (2,147,483,647) bytes.
I understand that jsoup is primarily an HTML parser rather than a dedicated large-file download tool. However, the documentation for maxBodySize(0) explicitly describes 0 as:
an infinite amount (bounded only by your patience and the memory available on your machine)
This makes the observed behaviour somewhat unexpected. More importantly, the truncation is silent: the InputStream reaches EOF normally, so the calling application has no indication that the response was incomplete.
Steps to reproduce
We use the Blender example.
Compare with command line wget
I think this probably regressed in bd92bca / #2448 when I refactored these buffers. The max caps were handled differently with an explicit boolean vs a sentinel.
Activity
jhy commentedon Sep 7, 2026
I think this probably regressed in bd92bca / #2448 when I refactored these buffers. The max caps were handled differently with an explicit boolean vs a sentinel.
Make bodyStream support configured caps, and responses over 2 GB (jhy…