Skip to content

Commit

Permalink
Replace ezgzip with bytesrw for Gzip (de)compression.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoj613 committed Oct 3, 2024
1 parent 8fec601 commit 8a31249
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions zarr/src/codecs/bytes_to_bytes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion zarr/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
(public_name zarr)
(libraries
yojson
ezgzip
bytesrw.zstd
bytesrw.zlib
stdint
checkseum)
(ocamlopt_flags
Expand Down

0 comments on commit 8a31249

Please sign in to comment.