Code example for InvalidPreferencesFormatException

0
    private String readTill(String s)
                    throws InvalidPreferencesFormatException 
    { 
        int index = line.indexOf(s);
        if (index == -1)
                throw new InvalidPreferencesFormatException(s + " not found");
 
        String read = line.substring(0, index);
        line = line.substring(index+s.length());
 
        return read;
    } 
 
    private String nextTag()
                    throws InvalidPreferencesFormatException, IOException 
    { 
        while(true) { 
            if (line == null)
                throw new InvalidPreferencesFormatException("unexpected EOF");
 
            int start = line.indexOf("<");