Win a copy of Mesos in Action this week in the Cloud/Virtualizaton 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
  • 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: 20529
54
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic