code: public String readUntil(char c) throws IOException {
          if (lookaheadChar == UNDEFINED) {
              lookaheadChar = super.read();
          }
          line.clear(); // reuse
          while (lookaheadChar != c && lookaheadChar != END_OF_STREAM) {
              line.append((char) lookaheadChar);
              if (lookaheadChar == '\n') {
                  lineCounter++;
              }
              lastChar = lookaheadChar;
              lookaheadChar = super.read();
          }
          return line.toString();
      }
docs: Reads all characters up to (but not including) the given character.
  
  @param c the character to read up to
  @return the string up to the character <code>c</code>
  @throws IOException