TextEncoder

Implements a JavaScript TextEncoderAPI.

Constructors

Link copied to clipboard
constructor(label: String?)

Create a TextEncoder from a JavaScript encoding label.

constructor()

Create a TextEncoder which uses the default JavaScript encoding (UTF-8).

constructor(encoding: JsEncoding)

Types

Link copied to clipboard

Properties

Link copied to clipboard
open override val encoding: String

Specifies the encoding implemented by this utility instance.

Functions

Link copied to clipboard
open override 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
open override 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.

open override 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.

open override 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.

open override fun encodeInto(text: String, bytes: ByteArray)
open override 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
open override 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