Method description:
Fill the specified data into the buffer.
Grammar:
buffer.fill(value, [offset], [end])
Receive parameters:
value The data to be filled
offet The starting position of the filled data. If not specified, the default is 0
end The end position of the padding data. If not specified, the default is the length of the buffer.
Example:
//In Example 1, the starting and ending positions of the filling content are not specified
var b = new Buffer(50);
b.fill("h");
//In Example 2, the starting and ending positions of the filling content are specified
var b = new Buffer(50);
var len = b.length;
b.fill("h" , len-1 , len);
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn