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

  • 相关阅读:
    总结面试常见题
    关于面试
    关于SQL经典题
    阶乘
    异常处理——捕获并抛出
    异常处理——异常越界
    异常处理——创建抛出
    输出异常
    抛出异常
    异常处理
  • 原文地址:https://www.cnblogs.com/fqlGlog/p/8968507.html
Copyright © 2011-2022 走看看