本文整理汇总了TypeScript中fs.ReadStream类的典型用法代码示例。如果您正苦于以下问题:TypeScript ReadStream类的具体用法?TypeScript ReadStream怎么用?TypeScript ReadStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ReadStream类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: store
store(fileid: any, datastream: ReadStream, callback) {
const outfile = createWriteStream(join(this.storeDir, `${fileid}.enc`));
let out = datastream.pipe(outfile);
out.once('error', function(err){
return callback(err);
});
out.once('close', function(){
return callback();
});
}
开发者ID:TetuSecurity,项目名称:Crypt,代码行数:10,代码来源:local_filestore.ts
示例2: stream
/**
* Starts streaming.
*
* @param {Boolean} [strict] Whether or not to be a jerk. Default: false.
* @param {{ trim: Boolean, normalize: Boolean, lowercase: Boolean, xmlns: Boolean, position: Boolean, strictEntities: Boolean }} [options] Options
* @returns {Stream}
*/
public stream(strict: boolean, options?: any) {
this.readStream = createReadStream(this.filename);
return this.readStream.pipe(this.createStream(strict, options));
}
开发者ID:freezy,项目名称:node-vpdb,代码行数:11,代码来源:xml.parser.ts
示例3: resume
/**
* Resumes a paused stream.
*/
public resume() {
this.paused = false;
while (this.stack.length > 0 && !this.paused) {
const e = this.stack.shift();
this.emit(e.name, e.data);
}
if (this.stack.length === 0) {
this.readStream.resume();
}
}
开发者ID:freezy,项目名称:node-vpdb,代码行数:13,代码来源:xml.parser.ts
示例4: pause
/**
* Pauses the stream. No further events will be submitted
* until {@link #resume()} is called.
*/
public pause() {
this.paused = true;
this.readStream.pause();
}
开发者ID:freezy,项目名称:node-vpdb,代码行数:8,代码来源:xml.parser.ts
注:本文中的fs.ReadStream类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论