code: public byte[] dumpClass(Class<?> cl) throws IOException {
          // get class fileName
          // Using File.separatorChar in Windows fails. paths for
          // Class#getResource() must be forward slashes in order to work
          // correctly.
          // See:
          // https://blogs.atlassian.com/2006/12/how_to_use_file_separator_when/
          String filename = cl.getName().replace('.', '/') + ".class";
          InputStream in = null;
          logger.debug("NetworkClassloader dumpClass() :" + cl.getCanonicalName());
          try {
              in = this.getResourceAsStream(filename);
              byte[] classBytes = IOUtils.toByteArray(in);
              return classBytes;
          } finally {
              if(null != in)
                  in.close();
          }
      }
docs: Utility function to convert Class --> byte[] <br>
  call {@link ClassLoader#getResource(String)} internally to find the class
  file and then dump the bytes[]
  
  @param cl The class
  @return Byte representation of the class
  @throws IOException