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);
};