TextEncoderStream
Encoding API
Encoding API
The TextEncoderStream interface of the converts a stream of strings into bytes in the UTF-8 encoding. It is the streaming equivalent of TextEncoder.
It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
Constructor
- TextEncoderStream()
- : Creates a new
TextEncoderStreamobject.
Instance properties
- TextEncoderStream.encoding
- : Always returns
"utf-8". - TextEncoderStream.readable
- : Returns the ReadableStream instance controlled by this object.
- TextEncoderStream.writable
- : Returns the WritableStream instance controlled by this object.
Examples
Examples of streaming structured data and HTML
Specifications
Browser compatibility
See also
- TextDecoderStream
- TextEncoder
- TransformStream
- Streams API Concepts
- Experimenting with the Streams API
- Streaming requests with the fetch API, developer.chrome.com (2020)