StringEncoder

class StringEncoder(charset: Charset)

Class encapsulating encoding/decoding for a certain charset

Constructors

Link copied to clipboard
fun StringEncoder(charset: Charset)

Functions

Link copied to clipboard
fun decode(source: ByteBuffer): String

Decode the full bytebuffer as string

fun decode(source: ByteBuffer, length: Int): String

Decode a string with known length from a bytebuffer

Link copied to clipboard
fun decodeChar(source: ByteBuffer): Char

Decode a single char from a bytebuffer

Link copied to clipboard
fun encode(data: String?): ByteBuffer

Encode a string into a bytebuffer

Link copied to clipboard
fun encodeChar(data: Char?): ByteBuffer

Encode a single char into a bytebuffer