[英]How to read a single-precision floating-point number from four bytes serialized by .NET's BinaryWriter
This is possible with node.js.这可以通过 node.js 实现。 Taken straight from the documentation :
直接取自文档:
var buf = new Buffer(4);
buf[0] = 0x00;
buf[1] = 0x00;
buf[2] = 0x80;
buf[3] = 0x3f;
console.log(buf.readFloatLE(0));
// 0x01
where LE
refers to little-endian.其中
LE
指的是小端。 There is a corresponding readFloatBE
for big-endian. big-endian 有一个对应的
readFloatBE
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.