/** * Loads INI formatted input from a stream reader into this instance. Everything in the stream * before the first section header is ignored. * * @param streamReader where to read from * @throws IOException at an I/O problem */ public void load(InputStreamReader streamReader) throws IOException { BufferedReader reader = new BufferedReader(streamReader); String curSection = null; String line = null; while (reader.ready()) { line = reader.readLine().trim(); if (line.length() > 0 && line.charAt(0) == Section.HEADER_START) { int endIndex = line.indexOf(Section.HEADER_END); if (endIndex >= 0) { curSection = line.substring(1, endIndex); addSection(curSection); } } if (curSection != null) { Section sect = getSection(curSection); sect.load(reader); } } }