public void parse(InputStream s) throws IOException { InputStreamReader isr = new InputStreamReader(s); BufferedReader br = new BufferedReader(isr); String context = "global"; int i;  getContext(context); for (String line = br.readLine(); line != null; line=br.readLine()) { line = line.trim(); if (line.length() == 0 || line.startsWith(";")) {  }  else { while (line.endsWith("\\")) { String more = br.readLine(); if (more == null) throw new IOException("Unexpected EOF"); line = line.substring(0,line.length()-1)+more.trim(); } if (line.startsWith("[") && line.endsWith("]")) { context = line.substring(1,line.length()-1); debug("Parsing PropertyGroup \""+context+"\""); if (hasContext(context)) { System.err.println("Multiple definition of PropertyGroup "+context); } getContext(context); } else if ( (i = line.indexOf("=")) >= 0) { String key = line.substring(0, i); String value = line.substring(i+1, line.length()); put(context, key, value); } else { debug("Bad line \""+line+"\""); } } }
public void parse() throws IOException { parse(inputStream);
  public void parse(InputStream s) throws IOException {    InputStreamReader isr = new InputStreamReader(s);    BufferedReader br = new BufferedReader(isr);    String context = "global";    int i;        getContext(context);    for (String line = br.readLine(); line != null; line=br.readLine()) {      line = line.trim();      if (line.length() == 0 || line.startsWith(";")) {        // empty or comment line      }  else {        while (line.endsWith("\\")) {          String more = br.readLine();          if (more == null) throw new IOException("Unexpected EOF");          line = line.substring(0,line.length()-1)+more.trim();        }        if (line.startsWith("[") && line.endsWith("]")) { // new context          context = line.substring(1,line.length()-1);          debug("Parsing PropertyGroup \""+context+"\"");          if (hasContext(context)) {            System.err.println("Multiple definition of PropertyGroup "+context);          }          getContext(context);  // setup the new context        }        else if ( (i = line.indexOf("=")) >= 0) { // key/value pair          String key = line.substring(0, i);          String value = line.substring(i+1, line.length());          put(context, key, value);        }         else {          debug("Bad line \""+line+"\"");        }      }    }  }