I have Sample.class file and Sample Class object at runtime, Then I modify a method body in A.class and redefine it with redefineClasses. how can I get the byte array(in a class file format) that represents the original Sample Class object before redefine?
Getting the Sample.class file from file system is not an idea, because the Class object can be transformed by a java agent before it is defined, I need to get byte array from the Class object directly.
Asked
Active
Viewed 73 times
1

nzomkxia
- 1,219
- 4
- 16
- 35
-
1Similar to http://stackoverflow.com/questions/2074033/get-bytes-for-a-class-that-was-generated-at-runtime ? – BretC Aug 25 '15 at 16:47