Skip to content

Commit 93368f2

Browse files
committed
fix edge case
1 parent 0136e92 commit 93368f2

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

  • modules/openapi-generator/src/main/resources/Java/libraries/native
  • samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,9 @@ public class ApiClient {
570570

571571
@Override
572572
public int read(byte[] b, int off, int len) throws IOException {
573+
if (len == 0) {
574+
return 0;
575+
}
573576
if (!fillBuffer()) {
574577
return -1;
575578
}

samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ApiClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,9 @@ public int read() throws IOException {
562562

563563
@Override
564564
public int read(byte[] b, int off, int len) throws IOException {
565+
if (len == 0) {
566+
return 0;
567+
}
565568
if (!fillBuffer()) {
566569
return -1;
567570
}

0 commit comments

Comments
 (0)