contents   index   previous   next



Buffer compare()

syntax:

buffer.compare(buffer2)

where:

buffer2 - buffer to compare against.

 

return:

negative if buffer < buffer2,
zero if buffer == buffer2
positive if buffer > buffer2

 

description:

This function is identical to calling Buffer.compare(buffer,buffer2).

 

see:

Buffer(), Buffer.compare (), Buffer.equal (), Buffer equal()

 

example:

// The following code:

var bufa = Buffer("ab");

var bufb = new Buffer("ab\0");

var cmp = bufa.compare(bufb)

// will set the variable cmp to be < 0


Buffer equal()