package tiny_httpd

  1. Overview
  2. Docs

Module Tiny_httpd.Byte_streamSource

Sourceval close : t -> unit
Sourceval of_chan : in_channel -> t

Make a buffered stream from the given channel.

Sourceval of_chan_close_noerr : in_channel -> t

Same as of_chan but the close method will never fail.

Sourceval of_bytes : ?i:int -> ?len:int -> bytes -> t

A stream that just returns the slice of bytes starting from i and of length len.

Sourceval 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.

Sourceval read_line : ?buf:Buf_.t -> t -> string

Read a line from the stream.

  • parameter buf

    a buffer to (re)use. Its content will be cleared.

Sourceval read_all : ?buf:Buf_.t -> t -> string

Read the whole stream into a string.

  • parameter buf

    a buffer to (re)use. Its content will be cleared.

OCaml

Innovation. Community. Security.