WritableStreamDefaultWriter

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!
您也可以阅读此文章的English (US)版。

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.

The WritableStreamDefaultWriter interface of the the Streams API provides is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying ssink.

Constructor

WritableStreamDefaultWriter()
Creates a new WritableStreamDefaultWriter object.

Properties

WritableStreamDefaultWriter.closedRead only
TBD
WritableStreamDefaultWriter.desiredSizeRead only
TBD
WritableStreamDefaultWriter.readyRead only
Returns a Promise that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.

Event handlers

Methods

WritableStreamDefaultWriter.abort()
TBD
WritableStreamDefaultWriter.close()
TBD
WritableStreamDefaultWriter.releaseLock()
Releases the writer's lock on the corresponding stream. After the lock is released, the writer is no longer active. If the associated stream is errored when the lock is released, the writer will appear errored in the same way from now on; otherwise, the writer will appear closed.
WritableStreamDefaultWriter.write()
Writes a passed chunk of data to a WritableStream and its underlying sink, then returns a Promise that resolves to indicate the success or failure of the write operation.

Examples

// TBD

Specifications

Specification Status Comment
Streams
The definition of 'WritableStreamDefaultWriter' in that specification.
Living Standard Initial definition.

Browser Compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 58 ? ? 45 ?
Feature Android Webview Chrome for Android Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile
Basic support 58 58 ? ? ? 45 ?

文档标签和贡献者