Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
type t = byte_stream
val close : t -> unit
val empty : t
val of_chan : in_channel -> t
Make a buffered stream from the given channel.
val of_chan_close_noerr : in_channel -> t
Same as of_chan
but the close
method will never fail.
val of_bytes : ?i:int -> ?len:int -> bytes -> t
A stream that just returns the slice of bytes starting from i
and of length len
.
val of_string : string -> t
val iter : (bytes -> int -> int -> unit) -> t -> unit
Iterate on the chunks of the stream
val to_chan : out_channel -> t -> unit
Write the stream to the channel.
val with_file : string -> (t -> 'a) -> 'a
Open a file with given name, and obtain an input stream on its content. When the function returns, the stream (and file) are closed.