Method description:
Detect whether the target is a buffer object. Will return true or false.
Grammar:
Buffer.isBuffer(obj)
Receive parameters:
obj The object being detected.
Example:
var b = new Buffer(50);
var c = b.toString('base64',0,10);
var d = Buffer.isEncoding('base64');
var e = Buffer.isBuffer(b);
console.log(d); //Return false
console.log(e); //Return true
Source code:
// Static methods
Buffer.isBuffer = function isBuffer(b) {
Return util.isBuffer(b);
};
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