A LineBufferedReader that wraps an InputStream.
Similar functionality as using an InputStreamReader, but provides hooks
to read at the byte level before setting the charset.
Optionally uses java.nio.charset directly, for extra flexibility
and a possible (but slight and unverified) performance improvement.
Called by read() when it needs its buffer filled.
Read characters into buffer, starting at pos, for len.
Can assume that len > 0. Only called if pos>=limit.
Return -1 if EOF, otherwise number of read chars.
This can be usefully overridden by sub-classes.