Module Tiny_httpd.Byte_stream
type t= byte_stream
val close : t -> unitval empty : tval of_chan : Stdlib.in_channel -> tMake a buffered stream from the given channel.
val of_chan_close_noerr : Stdlib.in_channel -> tSame as
of_chanbut theclosemethod will never fail.
val of_bytes : ?i:int -> ?len:int -> bytes -> tA stream that just returns the slice of bytes starting from
iand of lengthlen.
val of_string : string -> tval iter : (bytes -> int -> int -> unit) -> t -> unitIterate on the chunks of the stream
- since
- 0.3
val to_chan : Stdlib.out_channel -> t -> unitWrite the stream to the channel.
- since
- 0.3
val with_file : string -> (t -> 'a) -> 'aOpen a file with given name, and obtain an input stream on its content. When the function returns, the stream (and file) are closed.