Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

reading file from jar - Problem  RSS feed

 
Ganesh Gowtham
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • 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
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!