Module Msgpck.BytesBuf
MessagePack library decoding from bytes and writing in Buffers.
val read : ?pos:int -> buf_in -> int * t
read ?pos buf
is(nb_read, t)
, wherenb_read
is the number of bytes read frombuf
at pos?pos
, andt
is the decoded MessagePack value.@raise
Invalid_argument "msg" when there is no valid MessagePack value to be read frombuf
at positionpos
.
val read_all : ?pos:int -> buf_in -> int * t list
read_all ?pos buf
reads all messages found inbuf
. @returns a tuple(pos, l)
wherepos
is the new position in the buffer, andl
is the list of read messages.@raise
Invalid_argument "msg" when there is no valid MessagePack value to be read frombuf
at positionpos
.