Skip to content

Commit

Permalink
Fix GZip does not flush data
Browse files Browse the repository at this point in the history
  • Loading branch information
yuferovalex committed Aug 5, 2022
1 parent 1ab1fe9 commit 72af8a7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ private HttpEntity createHttpEntity(byte[] data) throws IOException {
}

private byte[] compressData(byte[] data) throws IOException {
try (var compressed = new ByteArrayOutputStream(data.length); var stream = new GZIPOutputStream(compressed)) {
var compressed = new ByteArrayOutputStream(data.length);
try (var stream = new GZIPOutputStream(compressed)) {
stream.write(data);
return compressed.toByteArray();
}
return compressed.toByteArray();
}

private void recreateRestClient() {
Expand Down

0 comments on commit 72af8a7

Please sign in to comment.