write

abstract fun write(string: String, offset: Int? = null, length: Int? = null, encoding: String? = null): Int

Encode a string and write it into the buffer at the given offset, optionally truncating the resulting bytes to match a specific length.