阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

    教程列表

    数据库
    抓包专区
    测试专区

    deno.reader

    UNSTABLE*: might make Reader into iterator of some sort.

    继承关系

    被谁实现

    索引

    Methods

    Methods

    read

    • read(p: Uint8Array): Promise<number | unique symbol>

    • 最多读取 p.byteLength 个字节到p中,然后返回读取的字节数(0 < n <= p.byteLength),并在遇到任何错误时返回拒绝状态的回调函数。 即使 read() 返回值为 n < p.byteLength,p也可能在调用期间被用作临时空间。 如果有数据可用,但不存在 p.byteLengthread() 通常会返回可用值,而不是等待更多。

      Reads up to p.byteLength bytes into p. It resolves to the number of bytes read (0 < n <= p.byteLength) and rejects if any error encountered. Even if read() resolves to n < p.byteLength, it may use all of p as scratch space during the call. If some data is available but not p.byteLength bytes, read() conventionally resolves to what is available instead of waiting for more.

      read() 遇到文件结束条件时,将返回 Deno.EOF 符号。

      When read() encounters end-of-file condition, it resolves to Deno.EOF symbol.

      read() 遇到错误时,它会返回拒绝状态的回调函数,参数值为错误信息。

      When read() encounters an error, it rejects with an error.

      调用者应始终处理返回值为 n > 0 的情况,然后再考虑 EOF。 应正确处理在读取一些字节以及两种被允许的EOF行为之后可能发生的 I/O 错误。

      Callers should always process the n > 0 bytes returned before considering the EOF. Doing so correctly handles I/O errors that happen after reading some bytes and also both of the allowed EOF behaviors.

      实现不应保留对 p 的引用。

      Implementations should not retain a reference to p.

      参数

      • p: Uint8Array

      返回 Promise<number | unique symbol>

    图例说明

    • Method

    本文档使用 TypeDoc 生成。

    卖前端学习教程

    只需几十元,就能买到培训班的内部教程!开启高薪之路!

    零基础小白阿里P7的教程都有!

    同时长期收购所有培训班的前端教程

    目录
    目录