1. 首页
  2. 考试认证
  3. 其它
  4. node passthrough truncate 截断流的最后N个字节 Node.js模块

node passthrough truncate 截断流的最后N个字节 Node.js模块

上传者: 2024-10-07 16:45:17上传 ZIP文件 4.23KB 热度 6次
节点直通截断截断流的最后N个字节的PassThrough流。例如,假设您将一个文件通过管道传输到deflate流中,并且您想删除末尾的0x00 0xff 。您不知道流将提前多长时间,但您知道需要删除最后4个字节。该模块通过保持足够的额外缓冲区来工作,以便在刷新流时至少缓冲N个字节,N是您希望截断的字节数。用法var PassThroughTruncate = require ( 'passthrough-truncate' ) ; // chop off the last 4 bytes of the stream myOtherStream . pipe ( new PassThroughTruncate ( 4 ) ) . pipe ( process . stdout ) ; API文档新的PassThroughStre
下载地址
用户评论