public static byte[] gzip(byte[] bytes) {
    if (bytes == null) {
      return null;
    }
    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
    try (GZIPOutputStream zipOutputStream = new GZIPOutputStream(byteArrayOutputStream)) {
      zipOutputStream.write(bytes);
      zipOutputStream.finish();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    return byteArrayOutputStream.toByteArray();
  }
Compress the given data using gzip.
amoro-ams/src/main/java/org/apache/amoro/server/utils/CompressUtil.java