encodeInto

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

Encode Into (Host Arrays)

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

This method uses host types, and is meant for host dispatch only.

Parameters

text

The string to encode.

bytes

The byte array to copy the encoded string into.


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

Encode Into (Host Buffers)

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

This method uses host types, and is meant for host dispatch only.

Parameters

text

The string to encode.

bytes

The byte buffer to copy the encoded string into.


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

Encode Into (Host Channels)

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

This method uses host types, and is meant for host dispatch only.

Parameters

text

The string to encode.

bytes

Output channel to write into.


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

Encode Into (Host Streams)

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

This method uses host types, and is meant for host dispatch only.

Note: The stream is not closed after writing.

Parameters

text

The string to encode.

bytes

Output stream to write into.


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

Encode Into

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

Parameters

text

The string to encode.

bytes

The byte array to copy the encoded string into.