private Iterator<String> parse(final Class<?> service, final URL url) {
        final ArrayList<String> names = new ArrayList<>();
        try (final InputStream in = url.openStream();
                final BufferedReader r = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))) {
            int lc = 1;
            // noinspection StatementWithEmptyBody
            while ((lc = parseLine(service, url, r, lc, names)) >= 0)
                ;
        } catch (final IOException x) {
            throw fail(service, "error reading configuration file", x);
        }
        return names.iterator();
    }
A simple service-provider loading facility (SPI).

@author jiachun.fjc
jraft-core/src/main/java/com/alipay/sofa/jraft/util/JRaftServiceLoader.java