• Post Reply Bookmark Topic Watch Topic
  • New Topic

Class name  RSS feed

 
Vadim Vgr
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
How to extract class file name from a byte array representation of class?
I have:
unsigned char* class_data; // bytecode array
jint class_data_len; // lenght of data
Please, help...
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Welcome to JavaRanch!
Well, there are Java libraries that dissect class files, and you could use one of them; see BCEL, for example. Another approach would be to write a simple "ByteArrayClassLoader" (or find one easily on the 'Net, I'm sure) which loaded the data as a class, and then query the resulting Class object for its name.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!