/** * Get the next line from the input * * @param bin The reader to get data from * @return the next line or null if there is nothing more * @throws IOException if encountered */ private String advance(BufferedReader bin) throws IOException { // Get the next non-blank, non-comment line String trimmed = null; for (String line = bin.readLine(); line != null; line = bin.readLine()) { // Remove leading and trailing whitespace trimmed = line.trim(); // skip blank and comment lines if (!isCommentLine(trimmed)) { return trimmed; } } return null; }