docs: @Nonnull
      public String getRestOfLine() throws IOException {
          if (preLoaded) {
              if (bufferOffset < 0 || buffer[bufferOffset] == '\n' ||
                  (lastChar == 0 && !readNextChar())) {
                  return "";
              }
  
              int start = bufferOffset;
              int length = 1;
              while (readNextChar()) {
                  if (lastChar == '\n') {
                      lastChar = 0;
                      break;
                  }
                  ++length;
              }
              return new String(buffer, start, length);
          }
  
          if (bufferOffset < 0 || buffer[bufferOffset] == '\n' ||
              bufferOffset >= (bufferLimit - 1) ||
              (lastChar == 0 && !readNextChar())) {
              return "";
          }
  
          maybeConsolidateBuffer();
          StringBuilder remainderBuilder = new StringBuilder();
          do {
              int unreadChars = bufferLimit - bufferOffset;
              remainderBuilder.append(buffer, bufferOffset, unreadChars - (bufferLineEnd ? 1 : 0));
              bufferOffset = bufferLimit;
              linePos += unreadChars;
  
              if (bufferLineEnd) {
                  break;
              }
              maybeConsolidateBuffer();
          } while (bufferOffset < (bufferLimit - 1));
  
          lastChar = 0;
          return remainderBuilder.toString();
      }