• offset {Number} 0

    				<li>noAssert {Boolean} 默认:false</li>
    
    				<li>返回:{Number}</li>
    </ul>

    从该 Buffer 指定的带有特定尾数格式(readInt16BE() 返回一个较大的尾数,readInt16LE() 返回一个较小的尾数)的 offset 位置开始读取一个16位整数值。

    设置 noAssert 为 true ,将跳过对 offset 的验证。这将允许 offset 超出缓冲区的末尾。

    从 Buffer 里读取的整数数值会被解释执行为有符号的2的补码值。

    const buf = Buffer.from([1, -2, 3, 4]);
    
    buf.readInt16BE();
    // returns 510
    buf.readInt16LE(1);
    // returns 1022

    buf.readInt16LE函数详解的更多相关文章

    1. buf.writeUInt8()函数详解

      buf.writeUInt8(value, offset[, noAssert]) value {Number} 需要被写入到 Buffer 的字节 offset {Number} 0 <= o ...

    2. buf.writeUIntBE()函数详解

      buf.writeUIntBE(value, offset, byteLength[, noAssert]) buf.writeUIntLE(value, offset, byteLength[, n ...

    3. buf.writeInt32BE()函数详解

      buf.writeInt32BE(value, offset[, noAssert]) buf.writeInt32LE(value, offset[, noAssert]) value {Numbe ...

    4. buf.writeInt16BE()函数详解

      buf.writeInt16BE(value, offset[, noAssert]) buf.writeInt16LE(value, offset[, noAssert]) value {Numbe ...

    5. buf.writeInt8()函数详解

      buf.writeInt8(value, offset[, noAssert]) value {Number} 需要被写入到 Buffer 的字节 offset {Number} 0 <= of ...

    6. buf.writeDoubleBE()函数详解

      buf.writeDoubleBE(value, offset[, noAssert]) buf.writeDoubleLE(value, offset[, noAssert]) value {Num ...

    7. buf.writeFloatBE()函数详解

      buf.writeFloatBE(value, offset[, noAssert]) buf.writeFloatLE(value, offset[, noAssert]) value {Numbe ...

    8. buf.writeIntBE()函数详解

      buf.writeIntBE(value, offset, byteLength[, noAssert]) buf.writeIntLE(value, offset, byteLength[, noA ...

    9. buf.readUInt32BE()函数详解

      buf.readUInt32BE(offset[, noAssert]) buf.readUInt32LE(offset[, noAssert]) offset {Number} 0 noAssert ...

    随机推荐

    1. 跟着alex学习了格式化输出,最大的感受就是编程这个事,一定要自己动手去做,才能学会。看会和自己会做完全是两码事

      学习了三天,现在学到格式化输出.看视频教程,alex和那个美女学员打情骂俏,真是羡慕啊. 教程看懂很容易,完全会了. 可是上手编程马上歇菜. 就这么几行的代码,我遇到了n多错误 首先是中文输入的错误, ...

    2. Ubuntu | Flask + Gunicorn + Nginx 部署服务器环境

      现在我们手里有一个准备发布的项目,那么如何将他上传到你的服务器,并让外网访问呢? 前提: 1. 安装了Python环境 apt-get install python-dev 2. 安装Flask pi ...

    3. xth 的玫瑰花(codevs 1360)

      题目描述 Description 这天是rabbit 的生日前夕,Xth 来到花店,要给他的rabbit 买玫瑰花,为了保证质 量,他跟花店老板——小菜儿同学要求自己到花田采摘.小菜儿灰常希望早日见到 ...

    4. readl()和writel()

      writel() 往内存映射的 I/O 空间上写数据,wirtel() I/O 上写入 32 位数据 (4字节). 原型: 引用 #include <asm/io.h> void writ ...

    5. MYSQL 字符集 MYSQL 源码

      http://blog.csdn.net/maray/article/details/46504621

    6. oracle latch

      (转载 : http://www.dbtan.com/2010/05/latch-free.html) Latch Free(闩锁释放):Latch Free通常被称为闩锁释放,这个名称常常引起误解, ...

    7. 在shell脚本中使用函数的返回值

      #!/bin/bash - function mytest() { echo "arg1 = $1" if [ $1 = "1" ] ;then return ...

    8. 微信获得access-token

      微信获得access-token RestTemplate template = new RestTemplate(); String appid = "aa"; String s ...

    9. Axure RP一个专业的高速原型设计工具

      Axure RP是一个专业的高速原型设计工具.Axure(发音:Ack-sure),代表美国Axure公司.RP则是Rapid Prototyping(高速原型)的缩写. Axure简要介绍 Axur ...

    10. Apache server配置

      Apacheserver在我们生活中非经常常使用 今天给大家将一下mac 下apache server的配置 这对程序来说是必备技能之中的一个,假设我们在公司开发都是用的公司的server 将自己的代 ...