简体   繁体   中英

How to find the package of a class file in java

I'm writing a java program that works with .class files. I want to be able to read a .class file on the filesystem (with InputStream) and determine the package that it is in. That .class file might not be in a nice package directory structure, it could be lying around in some random place. How can I do this?

阅读类文件格式文档 -或使用知道如何解析类文件的库,例如BCEL及其ClassParser类。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM