Encoding

Character encoding

Entries

Link copied to clipboard

UTF-8 character encoding

Link copied to clipboard

UTF-16 character encoding

Link copied to clipboard

ASCII encoding

Properties

Link copied to clipboard

the number of Byte required to encode a Char with this encoding

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard

Returns the number of Bytes required to encode a String using the given Encoding.

Link copied to clipboard
fun Encoding.copyCharIntoByteArray(char: Char, array: ByteArray, offset: Int = 0, byteOrder: ByteOrder): ByteArray

Encodes a Char using the given Encoding and ByteOrder and copies it into a ByteArray at a given offset.

Link copied to clipboard
fun Encoding.copyEncodedStringIntoArray(string: String, array: ByteArray, offset: Int = 0, byteOrder: ByteOrder): ByteArray

Encodes a String using the given Encoding and ByteOrder and copies it into a ByteArray at a given offset.

Link copied to clipboard
fun Encoding.encodeChar(char: Char, byteOrder: ByteOrder): ByteArray

Encodes a Char into a ByteArray using the given Encoding and ByteOrder.

Link copied to clipboard
fun Encoding.encodeString(string: String, byteOrder: ByteOrder): ByteArray

Encodes a String into a ByteArray using the given Encoding and ByteOrder.

Link copied to clipboard
fun valueOf(value: String): Encoding

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.