public static void load(Class<?> parent,ClassLoader cl){
  try {
    String fullName=RESOURCE_PREFIX + parent.getName();
    Enumeration<URL> configfiles=cl.getResources(fullName);
    while (configfiles.hasMoreElements()) {
      URL nextElement=configfiles.nextElement();
      char[] buf=new char[0x4000];
      try (InputStreamReader is=new InputStreamReader(nextElement.openStream(),"UTF-8")){
        int start=0, cur=0, valid=is.read(buf,0,buf.length);
        char c;
        while (cur < valid) {
          while (cur < valid && (c=buf[cur]) != '\n' && c != '\r') {
            cur++;
          }
          if (cur == valid && is.ready()) {
            if (start > 0) {
              System.arraycopy(buf,start,buf,0,valid - start);
              valid-=start;
              cur-=start;
              start=0;
            }
 else             if (valid == buf.length) {
              throw new IOException("Buffer size exceeded. Maximum line length in service files is: " + buf.length + " in file: "+ fullName);
            }
            valid=is.read(buf,valid,buf.length - valid);
            continue;
          }
          parseLine(parent,buf,start,cur,nextElement);
          while (cur < valid && ((c=buf[cur]) == '\n' || c == '\r')) {
            cur++;
          }
          start=cur;
        }
      }
 catch (      IOException x) {
        throw new AbortException("Error reading configuration file",x);
      }
    }
  }
 catch (  IOException x) {
    throw new AbortException("Could not load service configuration files.",x);
  }
}

public static void load ( Class < ? > parent , ClassLoader cl ) { try { String fullName = RESOURCE_PREFIX + parent . getName ( ) ; Enumeration < URL > configfiles = cl . getResources ( fullName ) ; while ( configfiles . hasMoreElements ( ) ) { URL nextElement = configfiles . nextElement ( ) ; char [ ] buf = new char [ 0x4000 ] ; try ( InputStreamReader is = new InputStreamReader ( nextElement . openStream ( ) , "UTF-8" ) ) { int start = 0 , cur = 0 , valid = is . read ( buf , 0 , buf . length ) ; char c ; while ( cur < valid ) { while ( cur < valid && ( c = buf [ cur ] ) != '\n' && c != '\r' ) { cur ++ ; } if ( cur == valid && is . ready ( ) ) { if ( start > 0 ) { System . arraycopy ( buf , start , buf , 0 , valid - start ) ; valid -= start ; cur -= start ; start = 0 ; } else if ( valid == buf . length ) { throw new IOException ( "Buffer size exceeded. Maximum line length in service files is: " + buf . length + " in file: " + fullName ) ; } valid = is . read ( buf , valid , buf . length - valid ) ; continue ; } parseLine ( parent , buf , start , cur , nextElement ) ; while ( cur < valid && ( ( c = buf [ cur ] ) == '\n' || c == '\r' ) ) { cur ++ ; } start = cur ; } } catch ( IOException x ) { throw new AbortException ( "Error reading configuration file" , x ) ; } } } catch ( IOException x ) { throw new AbortException ( "Could not load service configuration files." , x ) ; } }
load the service file .
