类文件读取本身 [英] class file reading itself

查看:63
本文介绍了类文件读取本身的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让.class文件自行读取?我需要从.class文件显示其代码(不是.java文件)


当我尝试ti时只需读取文件编译器说它找不到文件或者找不到它给定的路径

谢谢

解决方案

okey我必须提供完整的路径......但是如果我不想要的话提供完整路径,因为它将取决于我的系统上的路径


如果该类在您的类路径中,您可以使用 Class.getResourseAsStream()方法。


亲切的问候,


Jos


嗯我如何获得InputStream的长度?

How do i make a .class file read itself ? i need to display its code from .class file (not .java file)

when i try ti simply read the file compiler says it can not find the file or that it can not find the given path
thank You

解决方案

okey i had to provide the full path ... but what if i don''t want to give the full path because it will be dependent on the path on my system


If that class is in your classpath you can use the Class.getResourseAsStream() method.

kind regards,

Jos


hmm how do i get the length of the InputStream?


这篇关于类文件读取本身的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆