fromByteArray

mimics ``String(byte[] bytes, Charset charset)`` of jdk

Constructs a new String by decoding the specified array of bytes using the specified Charset. The length of the new String is a function of the charset, and hence may not be equal to the length of the byte array.

This method always replaces malformed-input and unmappable-character sequences with this charset's default replacement string. The [ ] class should be used when more control over the decoding process is required.

The contents of the string are unspecified if the byte array is modified during string construction.

@param bytes The bytes to be decoded into characters

@param charset The Charset to be used to decode the bytes

@since 1.6


fun String.Companion.fromByteArray(bytes: ByteArray, offset: Int, length: Int, charset: Charset): String

mimics public String(byte[] bytes, int offset, int length, Charset charset)