package binsec

  1. Overview
  2. Docs

doc/binsec.base/Binsec_base/Binstream/index.html

Module Binsec_base.BinstreamSource

Representation of binary streams

Types

Sourcetype t

Constructors

Sourceval empty : t
Sourceval of_nibbles : string -> t

of_nibbles s converts a string s of hexadecimal characters.

Assumes each character is in the range 0-9a-f.

Sourceval of_bytes : string -> t

of_bytes s converts a byte stream s. Each character stands for its own byte.

Sourceval of_list : int list -> t

of_list l converts a list of integers.

Assumes: each integer n is in the range 0 <= n <= 255.

Operations

Sourceval append_int : int -> t -> t
Sourceval prepend_int : int -> t -> t
Sourceval append_int64 : int64 -> t -> t
Sourceval prepend_int64 : int64 -> t -> t
Sourceval append_char : char -> t -> t
Sourceval prepend_char : char -> t -> t
Sourceval rev : t -> t

Iterators

Sourceval iter : (int -> unit) -> t -> unit
Sourceval map : (int -> int) -> t -> t
Sourceval fold : (int -> 'a -> 'a) -> t -> 'a -> 'a

Accessors

Sourceval length : t -> int
Sourceval get_byte : t -> int -> int option
Sourceval get_byte_exn : t -> int -> int

get_byte b n retrieves byte number n from b

The byte sequence is 0-indexed.

Sourceval to_string : t -> string

Printers

include Sigs.PRINTABLE with type t := t
Sourceval pp : Format.formatter -> t -> unit