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.
我正在使用 net 模块解析 TCP 字节流的块。每次调用“数据”事件时,我都会收到一个包含未知字节数的变量——有时高达 22k。有没有办法指定我只想使用最多 1024 个字节的块?
NodeJS v0.10.0引入了改进的 Streams API,其中包括对“可读”事件的支持以及从流中请求给定字节数的能力。