docs: private static String readLineFromReaderWithMark(final Reader input)
              throws IOException {
          char[] cbuf = new char[charBufferSize];
          try {
              input.mark(charBufferSize);
          } catch (IOException e) {
              // this should never happen
              LOG.warning("Caught exception setting mark on supporting reader: " + e);
              // fallback
              return readLineFromReaderWithoutMark(input);
          }
  
          // could be changed into do..while, but then
          // we might create an additional StringBuilder
          // instance at the end of the stream
          int count = input.read(cbuf);
          if (count == EOF) // we are at the end of the input data
              return null;
  
          StringBuilder line = new StringBuilder(expectedLineLength);
          // now work on the buffer(s)
          int ls = lineSeparatorIndex(cbuf, count);
          while (ls == -1) {
              line.append(cbuf, 0, count);
              count = input.read(cbuf);
              if (count == EOF) {
                  // we are at the end of the input data
                  return line.toString();
              }
              ls = lineSeparatorIndex(cbuf, count);
          }
          line.append(cbuf, 0, ls);
  
          // correct ls if we have \r\n
          int skipLS = 1;
          if (ls + 1 < count) {
              // we are not at the end of the buffer
              if (cbuf[ls] == '\r' && cbuf[ls + 1] == '\n') {
                  skipLS++;
              }
          } else {
              if (cbuf[ls] == '\r' && input.read() == '\n') {
                  skipLS++;
              }
          }
  
          //reset() and skip over last linesep
          input.reset();
          input.skip(line.length() + skipLS);
          return line.toString();
      }