write

open override fun write(string: String, offset: Int?, length: Int?, encoding: String?): Int

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