var buffer2=new Buffer(4); buffer2[0]=0x3; buffer2[1]=0x4; buffer2[2]=0x23; buffer2[3]=0x42; console.log(buffer2.readUInt16BE(0)); console.log(buffer2.readUInt16LE(0)); console.log(buffer2.readUInt16BE(1)); console.log(buffer2.readUInt16LE(1)); console.log(buffer2.readUInt16BE(2)); console.log(buffer2.readUInt16LE(2)); //这里输出的772 1027 1059 8964 是如何来的啊
↧