linliu-code commented on code in PR #12866:
URL: https://github.com/apache/hudi/pull/12866#discussion_r2106078755


##########
hudi-io/src/main/java/org/apache/hudi/io/compress/airlift/HoodieAirliftGzipCompressor.java:
##########
@@ -50,4 +53,20 @@ public int decompress(InputStream compressedInput,
       return readFully(stream, targetByteArray, offset, length);
     }
   }
+
+  @Override
+  public byte[] compress(byte[] data) throws IOException {
+    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+    try (HadoopOutputStream gzipOutputStream = 
gzipStreams.createOutputStream(byteArrayOutputStream)) {
+      gzipOutputStream.write(data);
+    }
+    return byteArrayOutputStream.toByteArray();
+  }
+
+  @Override
+  public ByteBuffer compress(ByteBuffer uncompressedBytes) throws IOException {
+    byte[] temp = new byte[uncompressedBytes.remaining()];
+    uncompressedBytes.get(temp);
+    return ByteBuffer.wrap(this.compress(temp));
+  }

Review Comment:
   We don't need. We can remove it. Let me do that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to