• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Class name

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
author and iconoclast
Posts: 24208
47
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic