protected byte[] getBytes(String path) throws java.io.IOException, ClassNotFoundException {
    byte[] b = null;
    if (codebases == null) {
      // reading from resources in the classpath
      b = getBytesFromResource(path);
      if (b != null) return b;
    } else {
      for (int i = 0; i < codebases.length; i++) {
        try {
          if (codebases[i].isDirectory()) {
            b = getBytesFromDirectory(path, codebases[i]);
          } else {
            b = getBytesFromArchive(path, codebases[i]);
          }
          if (b != null) return b;
        } catch (java.io.IOException e) {
        }
      }
    }
    throw new ClassNotFoundException("Cannot find class " + path);
  }