tag:blogger.com,1999:blog-17487316.post455921025870687339..comments2024-01-13T09:14:12.131+00:00Comments on The life of a Games Programmer: I hate java, I hate java, I hate java, I hate java....etc..Mikehttp://www.blogger.com/profile/15958965170878448339noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-17487316.post-67112830973422916862009-01-02T20:42:00.000+00:002009-01-02T20:42:00.000+00:00I too am having this issue on JDK6, WinXP. I've ac...I too am having this issue on JDK6, WinXP. I've actually passed a proper file (on the filesystem) in to similar code and it doesn't read a single entry. Using ZipFile works but that doesn't sort my HTTP file stream requirement. No idea as to what the issue is.<BR/><BR/>As an aside:<BR/>"IIRC, Java doesn't return values on assignment like C does." - I don't believe that's right. It does return values as C does.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-17487316.post-3060208304465813042008-12-07T17:47:00.000+00:002008-12-07T17:47:00.000+00:00Thats what Im afraid of. The fact it needs an unde...Thats what Im afraid of. The fact it needs an underlying FILE system, and won't work with HTTP file streams, or in memory streams for that matter.<BR/><BR/>I'll try it with a file stream, but thats of no use in the long term.Mikehttps://www.blogger.com/profile/15958965170878448339noreply@blogger.comtag:blogger.com,1999:blog-17487316.post-56040250869800798092008-12-07T14:30:00.000+00:002008-12-07T14:30:00.000+00:00I thought I'd break out NetBeans and give your cod...I thought I'd break out NetBeans and give your code a spin. I did this:<BR/><BR/> FileInputStream fis = new FileInputStream("/users/sloankelly/downloads/lunarlockout.zip");<BR/> BufferedInputStream bis = new BufferedInputStream(fis, 16384);<BR/> try <BR/> {<BR/> ZipInputStream in = new ZipInputStream(bis);<BR/> ZipEntry entry;<BR/> while( (entry = in.getNextEntry())!=null )<BR/> {<BR/> // process the ZIP<BR/> System.out.println(entry.getName());<BR/> }<BR/> in.close();<BR/> }<BR/> catch (Exception e)<BR/> {<BR/> <BR/> }<BR/><BR/>And it worked. It displayed a list of the files inside the zip. So, I think maybe the stream isn't getting populated, and so it's not able to get the entries.Sloan Kellyhttps://www.blogger.com/profile/14414349325917834198noreply@blogger.comtag:blogger.com,1999:blog-17487316.post-74983006843326003362008-12-07T10:35:00.000+00:002008-12-07T10:35:00.000+00:00Actually, that was taken from another Java program...Actually, that was taken from another Java program on the web, and even if I split it up, it still doesn't work. entry is always null.Mikehttps://www.blogger.com/profile/15958965170878448339noreply@blogger.comtag:blogger.com,1999:blog-17487316.post-43633788091290011052008-12-07T02:06:00.000+00:002008-12-07T02:06:00.000+00:00Hey Mike,IIRC, Java doesn't return values on assig...Hey Mike,<BR/><BR/>IIRC, Java doesn't return values on assignment like C does. try breaking this up to 2 parts:<BR/><BR/>while( (entry = in.getNextEntry())!=null ) {<BR/> ...;<BR/>}<BR/><BR/>to:<BR/><BR/>entry = in.getNextEntry();<BR/>while( entry !=null ) {<BR/> ...;<BR/> entry = in.getNextEntry();<BR/>}<BR/><BR/>Good luck!Anonymousnoreply@blogger.com