當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript fs.ReadStream類代碼示例

本文整理匯總了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;未經允許,請勿轉載。