package bare_encoding

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Input type.

An input is a source of bytes, used to decode.

val read_byte : unit -> char

Read a single byte.

  • raises Invalid_argument

    if input is exhausted

val read_i16 : unit -> int

Read 2 bytes, in little endian.

  • raises Invalid_argument

    if input is exhausted

val read_i32 : unit -> int32

Read 4 bytes, in little endian.

  • raises Invalid_argument

    if input is exhausted

val read_i64 : unit -> int64

Read 8 bytes, in little endian.

  • raises Invalid_argument

    if input is exhausted

val read_exact : bytes -> int -> int -> unit

read_exact buf i len reads len bytes into buf, starting at offset i

  • raises Invalid_argument

    if input has less than len bytes