#
cp.buffer
Internal byte buffer type. Allows additional chunks of bytes
to be concatonated relatively inexpensively, as well as peek
and pop
operations
to preview/read in chunks of bytes.
For example:
local buff = buffer.new()
buff:push("Hello")
buff:len() -- 5
buff:peek(2) -- "He"
buff:peek(7) -- nil
buff:write(" world!")
buff:len() -- 12
buff:peek(7) -- "Hello w"
buff:pop(3) -- "Hel"
buff:len() -- 9
buff:bytes() -- "lo world!"
#
API Overview
Functions - API calls offered directly by the extension
is
Constructors - API calls which return an object, typically one that offers API methods
clone fromHex new
Methods - API calls which can only be made on an object returned by a constructor
drop len peek pop push