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

猜你喜欢

转载自www.cnblogs.com/fqlGlog/p/8968507.html