zoukankan      html  css  js  c++  java
  • buf.readUInt16BE()

    buf.readUInt16BE(offset[, noAssert])
    buf.readUInt16LE(offset[, noAssert])

    • offset {Number} 0 <= offset <= buf.length - 2
    • noAssert {Boolean} 默认:false
    • 返回:{Number}
    从该 Buffer 指定的带有特定尾数格式(readUInt16BE() 返回一个较大的尾数,readUInt16LE() 返回一个较小的尾数)的 offset 位置开始读取一个无符号的16位整数值。 设置 noAssert 为 true ,将跳过对 offset 的验证。这将允许 offset 超出缓冲区的末尾。 例子: ``` const buf = Buffer.from([0x3, 0x4, 0x23, 0x42]);

    buf.readUInt16BE(0);
    // Returns: 0x0304
    buf.readUInt16LE(0);
    // Returns: 0x0403
    buf.readUInt16BE(1);
    // Returns: 0x0423
    buf.readUInt16LE(1);
    // Returns: 0x2304
    buf.readUInt16BE(2);
    // Returns: 0x2342
    buf.readUInt16LE(2);
    // Returns: 0x4223

  • 相关阅读:
    openssh的服务端配置文件
    SSH的端口转发
    ssh服务
    文件引入
    数据类型的转换
    作用域
    静态变量
    函数
    php嵌入html的解析过程
    PHP执行过程
  • 原文地址:https://www.cnblogs.com/lalalagq/p/9908686.html
Copyright © 2011-2022 走看看