package proton

  1. Overview
  2. Docs

Module Compress.StreamSource

Streaming compression writer that accepts incremental writes and emits protocol-framed compressed blocks (<= 1MB each).

Sourcetype t
Sourceval create : (string list -> unit Lwt.t) -> method_t -> t

create writer method creates a new streaming compressor. The caller should have already written any protocol packet header.

Sourceval write_bytes : t -> bytes -> int -> int -> unit Lwt.t

write_bytes t b off len appends len bytes from b at off into the stream. When the internal buffer reaches max_block_size, a frame is compressed and written.

Sourceval write_string : t -> string -> unit Lwt.t

write_string t s convenience wrapper for strings.

Sourceval write_char : t -> char -> unit Lwt.t

write_char t c writes a single byte.

Sourceval flush : t -> unit Lwt.t

flush t compresses and writes any buffered data as a final frame.