File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading file from jar - Problem

 
Ganesh Gowtham
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks !!!
i am trying to read the content of class files from jar .
though i can able to get the entry names from jar , i cant able to read the content .

below is the code whichi am using .


Please sugesst how to go ahead .
Thanks
 
Rob Spoor
Sheriff
Pie
Posts: 20368
43
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read from the JarInputStream directly. Everytime you call getNextJarEntry it positions itself to the next entry, and you can read its contents until all is read (read returns -1). Then you call getNextJarEntry again and read all again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic