module Bi_stream:Streaming utilities (experimental)sig..end
Stream format (independent from the biniou serialization format):
( ONE INT64 BYTE* )* ZERO
where INT64 is the length of a chunk (unsigned big-endian 64-bit int),
i.e. the number of following BYTEs.
ONE and ZERO are the single-byte representations of 1 and 0 and are used
to indicate whether the end of the stream is reached.
val read_stream : (string -> 'a array) -> Pervasives.in_channel -> 'a Stream.tread_stream of_string ic creates an OCaml stream from
an input channel ic. The data come in chunks and each chunk
is converted from a string to an array by calling of_string.
Raises Failure if the data in the channel is corrupted or if a
chunk is larger then Sys.max_string_length.
val write_stream : ?chunk_len:int ->
('a array -> string) -> Pervasives.out_channel -> 'a Stream.t -> unitwrite_stream to_string oc st writes an OCaml stream to the
output channel oc. It creates chunks of chunk_len,
except for the last chunk which is usually smaller.
chunk_len must be chosen such that the resulting strings are
smaller then Sys.max_string_length.chunk_len : has a default value of 1024.