SHIP:Sail:bufSet

From Serious Documentation
Jump to: navigation, search
Function Returns Introduced Description
bufSet Integer v5.1.0 Initialize a buffer with a data pattern.

See Also:

Prototype

Integer bufSet(Buffer buf, Node value[, Integer offset[, Integer ndx]]);

Parameters/Return Value

Parameter Data Type Description
buf Buffer Buffer to initialize
value Node Value to initialize to
ndx Integer Number of bytes to initialize
offset Integer Buffer offset to start at
Return Integer number of bytes initialized.

Detailed Description

The buffer will be initialized with the supplied value. If an index is supplied, the value will be written into the buffer that specific amount of times. If no index is supplied, the complete buffer will be written. If an offset is supplied, writing into the buffer will begin at the specified offset. If no offset is supplied, writing will begin at offset 0.


Examples

Example Result Notes
intResult = bufSet(bufEg1, 30);
5000 All bufEg1 indexes are initialized to 30