Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e179da

Browse files
committed
[refractor]GzipCompress
1 parent 197343b commit 5e179da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rpc-framework-simple/src/main/java/github/javaguide/compress/gzip/GzipCompress.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public byte[] compress(byte[] bytes) {
2424
throw new NullPointerException("bytes is null");
2525
}
2626
try (ByteArrayOutputStream out = new ByteArrayOutputStream();
27-
GZIPOutputStream gzip = new GZIPOutputStream(out)) {
27+
GZIPOutputStream gzip = new GZIPOutputStream(out)) {
2828
gzip.write(bytes);
2929
gzip.flush();
3030
gzip.finish();
@@ -40,7 +40,7 @@ public byte[] decompress(byte[] bytes) {
4040
throw new NullPointerException("bytes is null");
4141
}
4242
try (ByteArrayOutputStream out = new ByteArrayOutputStream();
43-
GZIPInputStream gunzip = new GZIPInputStream(new ByteArrayInputStream(bytes))) {
43+
GZIPInputStream gunzip = new GZIPInputStream(new ByteArrayInputStream(bytes))) {
4444
byte[] buffer = new byte[BUFFER_SIZE];
4545
int n;
4646
while ((n = gunzip.read(buffer)) > -1) {

0 commit comments

Comments
 (0)