• offset {integer} 开始读取之前要跳过的字节数。必须满足:0 <= offset <= buf.length - 2默认值: 0
    • 返回: {integer}

    buf 中指定的 offset 读取一个无符号大端序的 16 位整数值。

    1. const buf = Buffer.from([0x12, 0x34, 0x56]);
    2. console.log(buf.readUInt16BE(0).toString(16));
    3. // 打印: 1234
    4. console.log(buf.readUInt16BE(1).toString(16));
    5. // 打印: 3456