DecompressionStream

Baseline 2023

Newly available

Since May 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

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

构造函数

DecompressionStream()

创建一个新 DecompressionStream

实例属性

DecompressionStream.readable

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

DecompressionStream.writable

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

示例

在此示例中,使用 gzip 对 blob 进行解压缩。

js
const ds = new DecompressionStream("gzip");
const decompressedStream = blob.stream().pipeThrough(ds);

规范

Specification
Compression Standard
# decompression-stream

浏览器兼容性

BCD tables only load in the browser