code: public static ClassDefinition createClassDefinition(Serializable s, Class<?> clz)
     {
        if (s == null || clz == null)
           return null;
  
        String name = clz.getName();
        long serialVersionUID = 0L;
        byte[] data = null;
  
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        InputStream is = null;
        try
        {
           try
           {
              Field svuf = getSerialVersionUID(clz);
              if (svuf != null)
                 serialVersionUID = (long)svuf.get(s);
           }
           catch (Throwable t)
           {
              // No serialVersionUID value
           }
  
           String clzName = name.replace('.', '/') + ".class";
  
           is = SecurityActions.getClassLoader(s.getClass()).getResourceAsStream(clzName);
           int i = is.read();
           while (i != -1)
           {
              baos.write(i);
              i = is.read();
           }
  
           data = baos.toByteArray();
  
           return new ClassDefinition(name, serialVersionUID, data);
        }
        catch (Throwable t)
        {
           // Ignore
        }
        finally
        {
           if (is != null)
           {
              try
              {
                 is.close();
              }
              catch (IOException ioe)
              {
                 // Ignore
              }
           }
        }
        return null;
     }
docs: Create a class definition
  @param s The serializable
  @param clz The class
  @return The definition