readLineStrictTo
Reads a UTF-8-encoded line and appends its decoded characters to out. Throws an exception if the line exceeds limit or is not terminated by a line delimiter.
The limit counts bytes in the UTF-8-encoded line, not decoded characters. Line delimiter bytes are not included in the decoded line nor counted towards the limit. Therefore, this function may read up to limit + 2 bytes when the line ends with CRLF after limit bytes.
Important: This function consumes the bytes that form the line content from the channel and appends their decoded characters to out even if it fails to complete.
Return
the number of bytes read for the line content, or -1 if the channel is exhausted before a line can be read
Parameters
the destination to append the decoded line to; the line delimiter is not appended
the maximum number of bytes in the UTF-8-encoded line, excluding the line delimiter. Defaults to Long.MAX_VALUE.
line-ending mode. Accepts LF and CRLF by default.
Throws
if the line exceeds limit
if the channel is exhausted after reading line content but before a line delimiter is found