Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 TCP实现此协议。其中大部分是作为缓冲区接收的,可以使用 .toString('hex') 很好地读取,但有 AVL 部分提到“使用连续比特流编码。最后一个字节填充以对齐字节边界”,其中数据似乎以我无法正确阅读的不同方式编码。我应该如何阅读连续位蒸汽部分?
提前谢谢了!
您必须在使用连续比特流编码的 4 字节缓冲区中发送已读取的记录数的整数值:
const buffer = Buffer.alloc(4); buffer.writeIntBE([INT_VALUE], 0, 4);