the original code:
InputStream is = "".getClass().getResourceAsStream("/myfile");
DataInputStream dis = new DataInputStream(is);
or other form:
DataInputStream dis = new
DataInputStream(getClass().getResourceAsStream("/myfile");
question:
How can I use javaassist to modify the above bytecode to following form:
InputStream is = MyUtil.getResourceAsStream("".getClass(), "/myfile");
DataInputStream dis = new DataInputStream(is);
or:
DataInputStream dis = new
DataInputStream(MyUtil.getResourceAsStream(getClass(), "/myfile");
All in all, I want to know how can I use javasssist to change the bytecode
(obj.getClass().getResourceAsStream("/file")) to
the new bytecode : MyUtil.getResourceAsStream(obj.getClass(), "/file").
Thanks a lot.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3861040#3861040
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3861040
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user