package decompress
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=f91e6978beff3fcb61440d32f7c99c99f1e8654b4fb18408741d36035373ac60
    
    
  sha512=c3f402404f76075e6f692ea36e701134a5d833824d5d1166365c6c81fb18b309270bf288ce4c118ac44fd0366d9b6eea0a6309255678d8e1bd2bbfa7ba843461
    
    
  doc/decompress.gz/Gz/Inf/index.html
Module Gz.InfSource
The type for decoders.
The type for input sources. With a `Manual source the client must provide input with src. With `String or `Channel source the client can safely discard `Await case (with assert false).
decoder src ~o is a decoder that inputs from src.
Output buffer.
gz, as de, uses o buffer as internal buffer to store output. We recommend to allocate an io_buffer_size buffer as output buffer. Then, dst_rem decoder tells you how many unused bytes remain in o.
decode d0 is:
- `Await d1if- d0has a- `Manualinput source and awaits for more input. The client must use a- srcwith- d1to provide it.
- `Flush d1if given output buffer- o(see- decoder) needs to be drained before work can be resumed. The client must use- flushwith- d1to completely flush- o. Usually- owill be full and consist fully of bytes that need to be copied from the buffer, but sometimes only the first part of the buffer is used. In those cases- dst_remwill give you the amount of free/unused bytes remain in- o. These should not be copied since their contents are not part of the output. Instead, the first- bigstring_length o - Inf.dst_rem d1bytes should be copied when flushing- o.
- `Malformed errif given input is malformed.- erris a human-readable error message.
- `End d1if given input notify end of flow.- ois possibly not empty (it can be check with- dst_rem).
reset d is a d in its original state, as it was initialized by decoder.
src d s j l provides d with l bytes to read, starting at j in s. This byte range is read by calls to decode with d until `Await is returned. To signal the end of input call the function with l = 0.
dst_rem d is how many unused bytes remain in the output buffer of d.
src_rem d is how many unprocessed bytes remain in the input buffer of d.
flush d is a decoder where internal output buffer o is completely free to store bytes.
filename d returns the filename of the flow if it exists. This can be called anytime but should be called when the `End case appears (and ensure that the GZIP header was computed).
comment d returns the comment of the flow if it exists. This can be called anytime but should be called when the `End case appears (and ensure that the GZIP header was computed).
os d returns the os where the flow was compressed. It should be called when the `End case appears (and ensure that the GZIP header was computed).