writeString
Encodes the characters at startIndex up to endIndex from string in UTF-8 and writes it to this sink.
Parameters
the string to be encoded.
the index (inclusive) of the first character to encode, 0 by default.
the index (exclusive) of a character past to a last character to encode, string.length
by default.
Throws
when startIndex or endIndex is out of range of string indices.
when startIndex > endIndex
.
when the sink is closed.
when some I/O error occurs.
Samples
Encodes the characters at startIndex up to endIndex from chars in UTF-8 and writes it to this sink.
Parameters
the string to be encoded.
the index (inclusive) of the first character to encode, 0 by default.
the index (exclusive) of a character past to a last character to encode, chars.length
by default.
Throws
when startIndex or endIndex is out of range of chars indices.
when startIndex > endIndex
.
when the sink is closed.
when some I/O error occurs.
Samples
Encodes substring of string starting at startIndex and ending at endIndex using charset and writes into this sink.
Parameters
the string to encode into this sink.
the Charset to use for encoding.
the index of the first character to encode, inclusive, 0 by default.
the index of the last character to encode, exclusive, string.length
by default.
Throws
when startIndex or endIndex is out of range of string indices.
when startIndex > endIndex
.
when the sink is closed.
when some I/O error occurs.