package fuseau

  1. Overview
  2. Docs

Module IO_unix.InSource

include module type of Fuseau.Iostream.In
Sourceclass type t = object ... end

An input stream, i.e an incoming stream of bytes.

Sourceval create : ?close:(unit -> unit) -> input:(bytes -> int -> int -> int) -> unit -> t
Sourceval empty : t

Empty input, contains 0 bytes.

Sourceval of_string : ?off:int -> ?len:int -> string -> t

An input channel reading from the string.

  • parameter offset

    initial offset in the string. Default 0.

  • parameter len

    the length of the slice we read from. Default String.length s - off.

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

An input channel reading from the bytes buffer. See of_string for more details.

Sourceval input : t -> bytes -> int -> int -> int

Read bytes into the given buffer. This returns 0 only if the stream has reached its end.

Sourceval input_all : ?buf:bytes -> t -> string

input_all ic reads the whole content of ic into a string.

  • parameter buf

    the initial buffer to use internally.

Sourceval really_input : t -> bytes -> int -> int -> unit

Same as input, but reads exactly the demanded amount of bytes.

  • raises End_of_file

    if the input does not contain enough data.

Sourceval really_input_string : t -> int -> string

really_input_string ic n reads exactly n bytes of ic and returns them as a string.

  • raises End_of_file

    if the input does not contain enough data.

Sourceval concat : t list -> t

Read from each stream, in order

Sourceval close : t -> unit

Close the input stream. This is idempotent.

Sourceval copy_into : ?buf:bytes -> t -> Fuseau.Iostream.Out.t -> unit

Copy the whole stream into the given output.

Sourceval of_unix_fd : ?close_noerr:bool -> ?buf:bytes -> file_descr -> t
OCaml

Innovation. Community. Security.