File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
modules/openapi-generator/src/main/resources/Java/libraries/native Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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));
You can’t perform that action at this time.
0 commit comments