TextEncoder

Text Encoder

TextEncoder is part of the Encoding API, and provides facilities for encoding strings into, and decoding strings from, byte streams.

The TextEncoder interface represents an encoder for a specific method, that is a specific character encoding, like UTF-8, ISO-8859-2, KOI8, etc.

 

Summary

Text encoders can be created anywhere within the JavaScript context, as the class is installed at the TextEncoder symbol within the global namespace.

Inheritors

Types

Link copied to clipboard

Extends the base EncodingUtility.Factory to specialize it for the type TextEncoder.

Properties

Link copied to clipboard
abstract val encoding: String

Specifies the encoding implemented by this utility instance.

Functions

Link copied to clipboard
abstract fun encode(text: String): ByteArray
open fun encode(text: Value?): ByteArray

Encodes a string into a ByteArray containing the UTF-8 representation of the string.

Link copied to clipboard
abstract fun encodeInto(text: String, bytes: OutputStream)

Encodes a string into a ByteArray containing the UTF-8 representation of the string, and then copies it into the provided output stream.

abstract fun encodeInto(text: String, bytes: ByteBuffer)

Encodes a string into a ByteArray containing the UTF-8 representation of the string, and then copies it into the provided byte buffer.

abstract fun encodeInto(text: String, bytes: WritableByteChannel)

Encodes a string into a ByteArray containing the UTF-8 representation of the string, and then copies it into the provided writable channel.

abstract fun encodeInto(text: String, bytes: ByteArray)
abstract fun encodeInto(text: String, bytes: Value)
open fun encodeInto(text: Value?, bytes: Value?)

Encodes a string into a ByteArray containing the UTF-8 representation of the string, and then copies it into the provided byte array.

Link copied to clipboard
abstract fun getMember(key: String): Any
Link copied to clipboard
open override fun getMemberKeys(): Array<String>
Link copied to clipboard
open override fun hasMember(key: String?): Boolean
Link copied to clipboard
open override fun putMember(key: String?, value: Value?)
Link copied to clipboard
open override fun removeMember(key: String?): Boolean