8287134: HttpURLConnection chunked streaming mode doesn't enforce specified size

Reviewed-by: dfuchs, michaelm
This commit is contained in:
Conor Cleary 2023-01-26 08:35:07 +00:00
parent 4b0e656bb6
commit 48152ef66f

@ -277,9 +277,11 @@ public abstract class HttpURLConnection extends URLConnection {
* <p>
* This method must be called before the URLConnection is connected.
*
* @param chunklen The number of bytes to write in each chunk.
* If chunklen is less than or equal to zero, a default
* value will be used.
* @param chunklen The number of bytes to be written in each chunk,
* including a chunk size header as a hexadecimal string
* (minimum of 1 byte), two CRLF's (4 bytes) and a minimum
* payload length of 1 byte. If chunklen is less than or equal
* to 5, a higher default value will be used.
*
* @throws IllegalStateException if URLConnection is already connected
* or if a different streaming mode is already enabled.