readableStream.pipeTo(destination[, options])


  • destination <WritableStream> 一个 <WritableStream>,这个 ReadableStream 的数据将被写入其中。
  • options <Object>
    • preventAbort <boolean> 当值为 true 时,此 ReadableStream 中的错误不会导致 destination 被中止。
    • preventCancel <boolean> 当为 true 时,destination 中的错误不会导致此 ReadableStream 被取消。
    • preventClose <boolean> 当为 true 时,关闭此 ReadableStream 不会导致 destination 被关闭。
    • signal <AbortSignal> 允许使用 <AbortController> 取消数据传输。
  • 返回:一个以 undefined 解决的 Promise

在管道操作进行时,会导致 readableStream.lockedtrue

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