Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. Web API
  3. CompressionStream

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

CompressionStream

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2023年5月⁩.

* Some parts of this feature may have varying levels of support.

Compression Streams APICompressionStream 接口是一个用于压缩数据流的 API。

构造函数

CompressionStream()

创建新的CompressionStream

实例属性

CompressionStream.readable

返回由此对象控制的ReadableStream 实例。

CompressionStream.writable

返回由此对象控制的WritableStream 实例。

示例

在该示例中,使用 gzip 对流进行压缩。

js
const compressedReadableStream = inputReadableStream.pipeThrough(  new CompressionStream("gzip"),);

规范

Specification
Compression
# compression-stream

浏览器兼容性

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp