From e18eb687fbc7e738e2af514bcbea3bbcd65aba8d Mon Sep 17 00:00:00 2001 From: Zolisa Bleki Date: Thu, 3 Oct 2024 08:09:39 +0200 Subject: [PATCH] Replace ezgzip with bytesrw for Gzip (de)compression. --- dune-project | 1 - zarr.opam | 1 - zarr/src/codecs/bytes_to_bytes.ml | 7 +++++-- zarr/src/dune | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dune-project b/dune-project index bcbc163..e97ed39 100644 --- a/dune-project +++ b/dune-project @@ -29,7 +29,6 @@ (ocaml (and (>= 4.14.0))) (yojson (>= 1.6.0)) - (ezgzip (>= 0.2.0)) (stdint (>= 0.7.2)) (checkseum (>= 0.4.0)) (odoc :with-doc) diff --git a/zarr.opam b/zarr.opam index e38c4ff..75d2ebc 100644 --- a/zarr.opam +++ b/zarr.opam @@ -17,7 +17,6 @@ depends: [ "dune" {>= "3.15"} "ocaml" {>= "4.14.0"} "yojson" {>= "1.6.0"} - "ezgzip" {>= "0.2.0"} "stdint" {>= "0.7.2"} "checkseum" {>= "0.4.0"} "odoc" {with-doc} diff --git a/zarr/src/codecs/bytes_to_bytes.ml b/zarr/src/codecs/bytes_to_bytes.ml index 16951e1..fbb73c9 100644 --- a/zarr/src/codecs/bytes_to_bytes.ml +++ b/zarr/src/codecs/bytes_to_bytes.ml @@ -14,10 +14,13 @@ module GzipCodec = struct Error (Printf.sprintf "Invalid Gzip level %d" i) let encode l x = - Ezgzip.compress ~level:(to_int l) x + Bytes.Reader.to_string @@ + Bytesrw_zlib.Gzip.compress_reads ~level:(to_int l) () @@ + Bytes.Reader.of_string x let decode x = - Result.get_ok @@ Ezgzip.decompress x + Bytes.Reader.to_string @@ + Bytesrw_zlib.Gzip.decompress_reads () @@ Bytes.Reader.of_string x let to_yojson l = `Assoc diff --git a/zarr/src/dune b/zarr/src/dune index 88301b0..f7998cf 100644 --- a/zarr/src/dune +++ b/zarr/src/dune @@ -3,8 +3,8 @@ (public_name zarr) (libraries yojson - ezgzip bytesrw.zstd + bytesrw.zlib stdint checkseum) (ocamlopt_flags