Warning: Reason support is experimental. We are looking for beta-tester and contributors.

Module type Lwt_io.NumberIO

module type NumberIO = sig..end

Common interface for reading/writing integers in binary


Reading

val read_int : Lwt_io.input_channel -> int Lwt.t

Reads a 32-bits integer as an ocaml int

val read_int16 : Lwt_io.input_channel -> int Lwt.t
val read_int32 : Lwt_io.input_channel -> int32 Lwt.t
val read_int64 : Lwt_io.input_channel -> int64 Lwt.t
val read_float32 : Lwt_io.input_channel -> float Lwt.t

Reads an IEEE single precision floating point value

val read_float64 : Lwt_io.input_channel -> float Lwt.t

Reads an IEEE double precision floating point value

Writing

val write_int : Lwt_io.output_channel -> int -> unit Lwt.t

Writes an ocaml int as a 32-bits integer

val write_int16 : Lwt_io.output_channel -> int -> unit Lwt.t
val write_int32 : Lwt_io.output_channel -> int32 -> unit Lwt.t
val write_int64 : Lwt_io.output_channel -> int64 -> unit Lwt.t
val write_float32 : Lwt_io.output_channel -> float -> unit Lwt.t

Writes an IEEE single precision floating point value

val write_float64 : Lwt_io.output_channel -> float -> unit Lwt.t

Writes an IEEE double precision floating point value