Skip to content

Commit 4d20a06

Browse files
committed
added docstring
1 parent aed3f1f commit 4d20a06

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,14 @@ public class ApiClient {
460460
return connectTimeout;
461461
}
462462

463+
/**
464+
* Returns the response body InputStream, transparently decoding gzip-compressed
465+
* payloads when the server sets {@code Content-Encoding: gzip}.
466+
*
467+
* @param response HTTP response whose body should be consumed
468+
* @return Original or decompressed InputStream for the response body
469+
* @throws IOException if the response body cannot be accessed or wrapping fails
470+
*/
463471
public static InputStream getResponseBody(HttpResponse<InputStream> response) throws IOException {
464472
if (response == null) {
465473
return null;
@@ -480,6 +488,13 @@ public class ApiClient {
480488
}
481489

482490
{{#useGzipFeature}}
491+
/**
492+
* Wraps a request body supplier with a streaming GZIP compressor so large payloads
493+
* can be sent without buffering the entire contents in memory.
494+
*
495+
* @param bodySupplier Supplies the original request body InputStream
496+
* @return BodyPublisher that emits gzip-compressed bytes from the supplied stream
497+
*/
483498
public static HttpRequest.BodyPublisher gzipRequestBody(Supplier<InputStream> bodySupplier) {
484499
Objects.requireNonNull(bodySupplier, "bodySupplier must not be null");
485500
return HttpRequest.BodyPublishers.ofInputStream(() -> new GzipCompressingInputStream(bodySupplier));

0 commit comments

Comments
 (0)