流以buffer的形式存在
stream 類
readable(可讀流) writeable(可寫流) duplex(雙峰流) transform(轉(zhuǎn)換流)
可讀流:流動模式(resume)和暫停模式(pause) 負(fù)責(zé)讀取外部的數(shù)據(jù)贫悄,存儲到buffer數(shù)組中
可寫流:負(fù)責(zé)消費數(shù)據(jù)淘邻,對可讀流得到的數(shù)據(jù),然后對得到的chunk進(jìn)行處理
pipe方法
流以buffer的形式存在
stream 類
readable(可讀流) writeable(可寫流) duplex(雙峰流) transform(轉(zhuǎn)換流)
可讀流:流動模式(resume)和暫停模式(pause) 負(fù)責(zé)讀取外部的數(shù)據(jù)贫悄,存儲到buffer數(shù)組中
可寫流:負(fù)責(zé)消費數(shù)據(jù)淘邻,對可讀流得到的數(shù)據(jù),然后對得到的chunk進(jìn)行處理
pipe方法