Make.Reader
Abstractions for reading from various sources.
type t = {
read : bytes -> int -> int -> int;
read_ba : (int ->
(char, Stdlib.Bigarray.int8_unsigned_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array1.t)
option;
custom_parser : custom_parser option;
seek : int -> unit;
size : unit -> int option;
reset : unit -> unit;
}
A function to read taking the buffer to fill the offset and the length and returning the number of bytes actually read.
val reset : t -> unit
Go back at the beginning of the stream.
val with_file :
?custom_parser:custom_parser ->
(t -> metadata) ->
string ->
metadata
Specialize a parser to operate on files.
val with_string :
?custom_parser:custom_parser ->
(t -> metadata) ->
string ->
metadata
Specialize a parser to operate on strings.