SHIP:Sail:bufGet

From Serious Documentation
Jump to: navigation, search
Function Returns Introduced Description
bufGet Integer v5.1.0 Retrieves data from a buffer.

See Also:

Prototype

Integer bufGet(Buffer buf Integer offset Node var[, ...]);

Parameters/Return Value

Parameter Data Type Description
buf Buffer Buffer to use for extraction
offset Integer Offset into buffer
var Node Object to store extracted data
... Node Multiple receive Nodes can be specified
Return Integer total number of bytes retrieved from the buffer.

Detailed Description

Extracts data from a buffer and stores it into the designated object of type Node. The data will be converted to the datatype specified to receive it. Retrieval of data will begin at the offset specified. If multiple received objects are specified, data will be read from sequentially from the buffer in order to fill the next object.


Examples

Example Result Notes
bufGet(infoBuf, 30, strEg1); 30
bufGet(splashBuf, 0, intEg1); 4