set.add(provider()); while (en.hasMoreElements()) { BufferedReader rdr = new BufferedReader(new InputStreamReader (((URL) (en.nextElement())).openStream())); while (true) { String s = rdr.readLine(); if (s == null) break; CharsetProvider p = (CharsetProvider) ((Class.forName(s)).newInstance()); set.add(p); } }
while (i.hasNext()) set.add(i.next());
  private static CharsetProvider[] providers2()  {    if (providers == null)      {        try          {            Enumeration en = ClassLoader.getSystemResources	      ("META-INF/services/java.nio.charset.spi.CharsetProvider");            LinkedHashSet set = new LinkedHashSet();            set.add(provider());            while (en.hasMoreElements())              {                BufferedReader rdr = new BufferedReader(new InputStreamReader                  (((URL) (en.nextElement())).openStream()));                while (true)                  {                    String s = rdr.readLine();                    if (s == null)		      break;                    CharsetProvider p =		      (CharsetProvider) ((Class.forName(s)).newInstance());                    set.add(p);                  }	}            providers = new CharsetProvider[set.size()];            set.toArray(providers);          }        catch (Exception e)  {            throw new RuntimeException(e);          }      }    return providers;	}