module Io:High-order abstract I/O.sig
..end
IO module simply deals with abstract inputs/outputs. It provides a
set of methods for working with these IO as well as several
constructors that enable to write to an underlying channel, buffer,
or enum.
type
input
exception No_more_input
read
or
nread
functions while there is no available token to read.exception Input_closed
val nread : input -> int -> Istring.t
nread i n
reads a string of size up to n
from an input.
The function will raise No_more_input
if no input is available.
It will raise Invalid_argument
if n
< 0.
val close_in : input -> unit
val create_in : (unit -> char) ->
(Istring.t -> int -> int -> int) -> (unit -> unit) -> input
val read_all : input -> Istring.t
read all the contents of the input until No_more_input
is raised.
Here is some API useful for working with binary files, in particular
binary files generated by C applications. By default, encoding of
multibyte integers is low-endian. The BigEndian module provide multibyte
operations with other encoding.
exception Overflow of string
val read_byte : input -> int
val read_ui16 : input -> int