Buffer:unpack(format) method
Deserialize the Buffer, using the provided format.
Parameters
format
A format string to specify the binary layout to serialize the values. See Lua programming reference "string.pack" for available sequence of conversions options.
Return value
Returns the original values.
Example
-- create a Buffer with 3 bytes
local b = sys.Buffer({1, 1, 21})
-- deserialize values from bytes
local day, month, year = b:unpack("BBB")
print("Today is "..day.."/"..month.."/"..year)