# Module Zlib

    module Zlib: sig .. end

    exception Error of string * string

    val compress : ?level:int ->
           ?header:bool -> (bytes -> int) -> (bytes -> int -> unit) -> unit

    val compress_direct : ?level:int ->
           ?header:bool ->
           (bytes -> int -> unit) -> (bytes -> int -> int -> unit) * (unit -> unit)

    val uncompress : ?header:bool -> (bytes -> int) -> (bytes -> int -> unit) -> unit

    val plain_uncompress : string -> int -> string -> int -> bool

    type stream

    type flush_command =

`|` | `Z_NO_FLUSH`
`|` | `Z_SYNC_FLUSH`
`|` | `Z_FULL_FLUSH`
`|` | `Z_FINISH`

    val deflate_init : int -> bool -> stream

    val deflate : stream ->
           bytes ->
           int -> int -> bytes -> int -> int -> flush_command -> bool * int * int

    val deflate_string : stream ->
           string ->
           int -> int -> bytes -> int -> int -> flush_command -> bool * int * int

    val deflate_end : stream -> unit

    val inflate_init : bool -> stream

    val inflate : stream ->
           bytes ->
           int -> int -> bytes -> int -> int -> flush_command -> bool * int * int

    val inflate_string : stream ->
           string ->
           int -> int -> bytes -> int -> int -> flush_command -> bool * int * int

    val inflate_end : stream -> unit

    val update_crc : int32 -> bytes -> int -> int -> int32

    val update_crc_string : int32 -> string -> int -> int -> int32