readableStream.pipeTo(destination[, options])


  • destination <WritableStream> 将写入此 ReadableStream 的数据的 <WritableStream>

    ¥destination <WritableStream> A <WritableStream> to which this ReadableStream's data will be written.

  • options <Object>

    • preventAbort <boolean>true 时,此 ReadableStream 中的错误不会导致 destination 中止。

      ¥preventAbort <boolean> When true, errors in this ReadableStream will not cause destination to be aborted.

    • preventCancel <boolean>true 时,destination 中的错误不会导致此 ReadableStream 被取消。

      ¥preventCancel <boolean> When true, errors in the destination will not cause this ReadableStream to be canceled.

    • preventClose <boolean> true 时,关闭这个 ReadableStream 不会导致 destination 关闭。

      ¥preventClose <boolean> When true, closing this ReadableStream does not cause destination to be closed.

    • signal <AbortSignal> 允许使用 <AbortController> 取消数据传输。

      ¥signal <AbortSignal> Allows the transfer of data to be canceled using an <AbortController>.

  • 返回:undefined 兑现的 promise

    ¥Returns: A promise fulfilled with undefined

当管道操作处于活动状态时,使 readableStream.locked 变为 true

¥Causes the readableStream.locked to be true while the pipe operation is active.