From 5e179da7b357f005c1267613df1cd33a38701ccf Mon Sep 17 00:00:00 2001 From: guide Date: Sun, 14 Mar 2021 21:18:49 +0800 Subject: [PATCH] [refractor]GzipCompress --- .../java/github/javaguide/compress/gzip/GzipCompress.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc-framework-simple/src/main/java/github/javaguide/compress/gzip/GzipCompress.java b/rpc-framework-simple/src/main/java/github/javaguide/compress/gzip/GzipCompress.java index 820e022..9248bcc 100644 --- a/rpc-framework-simple/src/main/java/github/javaguide/compress/gzip/GzipCompress.java +++ b/rpc-framework-simple/src/main/java/github/javaguide/compress/gzip/GzipCompress.java @@ -24,7 +24,7 @@ public class GzipCompress implements Compress { throw new NullPointerException("bytes is null"); } try (ByteArrayOutputStream out = new ByteArrayOutputStream(); - GZIPOutputStream gzip = new GZIPOutputStream(out)) { + GZIPOutputStream gzip = new GZIPOutputStream(out)) { gzip.write(bytes); gzip.flush(); gzip.finish(); @@ -40,7 +40,7 @@ public class GzipCompress implements Compress { throw new NullPointerException("bytes is null"); } try (ByteArrayOutputStream out = new ByteArrayOutputStream(); - GZIPInputStream gunzip = new GZIPInputStream(new ByteArrayInputStream(bytes))) { + GZIPInputStream gunzip = new GZIPInputStream(new ByteArrayInputStream(bytes))) { byte[] buffer = new byte[BUFFER_SIZE]; int n; while ((n = gunzip.read(buffer)) > -1) { -- GitLab