zoukankan      html  css  js  c++  java
  • node的输入输出流

     在nodejs中可以使用flowing模式与非flowing模式来读取数据,当使用flowing模式时,将使用操作系统的i/o机制来读取数据,这将允许你以最快的速度来读取数据。当你使用非flowing模式时,你必须显示的调用对象的read方法来读取数据

      输入:

        实现了readabled接口的对象

          fs.readStream、http.incomingMessage、net.Socket、child.stdout、child.stderr、process.stdin、Gzip、Deflate、DeflateRaw

        会触发的事件

          readable、data、end、close、error

        拥有的方法与属性

          pipe、unpipe、unshift、read、pause、resume、setEncoding

      输出:

        实现了writeabled接口的对象

          fs.writestream、process.stdout、process.stdout、child.stdin、net.Socket、http.ClientRequest、http.ServerResesponse、Gunzip、Infalte、InflateRaw

        会触发的事件

          drain、pipe、unpipe、finish、error

        拥有的方法与属性

          end、write

  • 相关阅读:
    P4715 【深基16.例1】淘汰赛
    P4913 【深基16.例3】二叉树深度
    P1478 陶陶摘苹果(升级版)
    P1223 排队接水
    【深基12.例1】部分背包问题
    全排列和组合
    P1036 选数
    100——第25例
    100——第24例
    100——第23例
  • 原文地址:https://www.cnblogs.com/fqlGlog/p/8968507.html
Copyright © 2011-2022 走看看