Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Xith regression from SVN #2  (Read 3272 times)
0 Members and 1 Guest are viewing this topic.
Offline hawkwind

Junior Member




Java games rock!


« Posted 2006-11-08 02:14:10 »

I am sometimes, but not always, seeing the following

java.util.zip.ZipException: invalid stored block lengths
   at java.util.zip.InflaterInputStream.read(Unknown Source)
   at java.util.zip.ZipInputStream.read(Unknown Source)
   at java.util.zip.ZipInputStream.closeEntry(Unknown Source)
   at java.util.zip.ZipInputStream.getNextEntry(Unknown Source)
   at org.xith3d.loaders.texture.TextureStreamLocatorZip.openTextureStream(TextureStreamLocatorZip.java:83)
   at org.xith3d.loaders.texture.TextureLoader.getTexture(TextureLoader.java:671)
   at org.xith3d.loaders.texture.TextureLoader.getTexture(TextureLoader.java:781)
   at org.xith3d.loaders.texture.TextureLoader.getTexture(TextureLoader.java:795)
   at org.xith3d.ui.hud.base.LabeledStateButton$Description.setTexture(LabeledStateButton.java:75)
   at org.xith3d.ui.hud.utils.WidgetTheme.getCheckBoxDescription(WidgetTheme.java:311)
   at org.xith3d.ui.hud.widgets.Checkbox.<init>(Checkbox.java:170)
   
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #1 - Posted 2006-11-08 12:50:50 »

I am sometimes, but not always, seeing the following

java.util.zip.ZipException: invalid stored block lengths
   at java.util.zip.InflaterInputStream.read(Unknown Source)
   at java.util.zip.ZipInputStream.read(Unknown Source)
   at java.util.zip.ZipInputStream.closeEntry(Unknown Source)
   at java.util.zip.ZipInputStream.getNextEntry(Unknown Source)
   at org.xith3d.loaders.texture.TextureStreamLocatorZip.openTextureStream(TextureStreamLocatorZip.java:83)
   at org.xith3d.loaders.texture.TextureLoader.getTexture(TextureLoader.java:671)
   at org.xith3d.loaders.texture.TextureLoader.getTexture(TextureLoader.java:781)
   at org.xith3d.loaders.texture.TextureLoader.getTexture(TextureLoader.java:795)
   at org.xith3d.ui.hud.base.LabeledStateButton$Description.setTexture(LabeledStateButton.java:75)
   at org.xith3d.ui.hud.utils.WidgetTheme.getCheckBoxDescription(WidgetTheme.java:311)
   at org.xith3d.ui.hud.widgets.Checkbox.<init>(Checkbox.java:170)
   

This is strange Huh rafa_es described such an exception, too. But I cannot really fix it, when I don't get this exception, too. But I'll try to investigate. Thanks for the hint.

Marvin
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #2 - Posted 2006-11-09 23:39:34 »

I tried to find the problem, but wasn't able to trace it. Could you maybe send me en example, where the Exception is thrown? Even if it is not always thrown, it could help me.

Marvin
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Matthias

Senior Member


Medals: 3
Projects: 1


TWL - Themable Widget Library


« Reply #3 - Posted 2006-11-15 02:42:42 »

Hi,

I think this is caused by these changes: http://xith3d.svn.sourceforge.net/viewvc/xith3d/trunk/src/org/xith3d/loaders/texture/TextureLoader.java?r1=328&r2=330

The buffering of the imput stream was removed and replaced by using mark() on the input stream. This CAN NOT WORK because of the following reasons:
1. mark() may be called by the TextureStreamLoaders
2. the stream is not reset() after a TextureStreamLoaders was called.

This will lead to an invalid stream position when a TextureStreamLoaders was not able to decode the stream.

I wanted to object to thís change - but I was unable to log into JGO for several month.

Ciao Matthias
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #4 - Posted 2006-11-15 02:47:41 »

Hi,

I think this is caused by these changes: http://xith3d.svn.sourceforge.net/viewvc/xith3d/trunk/src/org/xith3d/loaders/texture/TextureLoader.java?r1=328&r2=330

The buffering of the imput stream was removed and replaced by using mark() on the input stream. This CAN NOT WORK because of the following reasons:
1. mark() may be called by the TextureStreamLoaders
2. the stream is not reset() after a TextureStreamLoaders was called.

This will lead to an invalid stream position when a TextureStreamLoaders was not able to decode the stream.

I wanted to object to thís change - but I was unable to log into JGO for several month.

Ciao Matthias

Well, what do you suggest to do for Zip loader? Do we need to cache all contained textures when the stream is opened? I would be happy to hear of a solution.

Marvin
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #5 - Posted 2006-11-15 18:50:43 »

but I was unable to log into JGO for several month.

Ah okay so you're still working with Xith3D ? What are you doing with it (if It's not secret) ?

Anyway, nice to see you again.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline Matthias

Senior Member


Medals: 3
Projects: 1


TWL - Themable Widget Library


« Reply #6 - Posted 2006-11-17 21:52:58 »

Ah okay so you're still working with Xith3D ? What are you doing with it (if It's not secret) ?

I'm currently not using Xith3D - I'm building my own 3D engine. That means that it's unlikely that you will see any code from me for Xith3D in the near future.

And I don't know what this TextureStreamLocatorZip is. But I think it will open a ZipFile and then return a InputStream for the requested entry. The resulting Texture is then cached (if enabled) - so I see no problem there.

In the mean time you can check out my website

Ciao Matthias
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #7 - Posted 2006-11-18 03:58:18 »

And I don't know what this TextureStreamLocatorZip is. But I think it will open a ZipFile and then return a InputStream for the requested entry. The resulting Texture is then cached (if enabled) - so I see no problem there.

I wrote this locator for the HUD theme system. There're all Textures needed for a theme in one zip archive. I just realized, that I don't seem to have finished the work on that locator. I wanted to make use of a cache for ZipEntries. I'll have a look at it. Maybe I can easily remove the need for stream-marks...

Marvin
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #8 - Posted 2006-11-18 23:18:43 »

The buffering of the imput stream was removed and replaced by using mark() on the input stream. This CAN NOT WORK because of the following reasons:
1. mark() may be called by the TextureStreamLoaders
2. the stream is not reset() after a TextureStreamLoaders was called.

This will lead to an invalid stream position when a TextureStreamLoaders was not able to decode the stream.

I checked this thing. And now I remember exactly, why I decided to change this. And it should not be a problem. I modified the ZIP loader to solve the above problem.

The buffering of the imput stream was removed and replaced by using mark() on the input stream. This CAN NOT WORK because of the following reasons:

It can Smiley.

1. mark() may be called by the TextureStreamLoaders

We can handle to not do this. So far it isn't.

2. the stream is not reset() after a TextureStreamLoaders was called.

This will lead to an invalid stream position when a TextureStreamLoaders was not able to decode the stream.

It is called by the TextureStreamLoader implementation in case it wasn't able to decode the stream. So the stream position is valid for any subsequent call of a TextureStramLoader and is irrelevant, if the the stream could be decoded.

So it should not be a problem and is faster, because the stream is not copied into a byte array. And if the byte array stream reader calls mark(), it could lead to problems, if it couldn't decode the stream and other loaders depend on the mark / reset system.

So the current solution should be faster and safer in any case.

Do you agree?

Marvin
Offline Matthias

Senior Member


Medals: 3
Projects: 1


TWL - Themable Widget Library


« Reply #9 - Posted 2006-11-19 01:32:41 »

So the current solution should be faster and safer in any case.

Do you agree?
It may be a little bit faster - but not safer - the ByteStreamReader was being recreated for each loader - so it could call mark() and reset() as much as it liked.

But you should move the reset() out of the TextureStreamLoader because they don't call the mark() method. Then change the spec that TextureStreamLoaders are not allowed to do mark() and reset() this will result in a cleaner (but restricted) API.

Ciao Matthias
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #10 - Posted 2006-11-19 01:49:30 »

But you should move the reset() out of the TextureStreamLoader because they don't call the mark() method. Then change the spec that TextureStreamLoaders are not allowed to do mark() and reset() this will result in a cleaner (but restricted) API.

OK. Will do this tomorrow.

Marvin
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #11 - Posted 2006-11-20 00:24:05 »

OK. Will do this tomorrow.

Done Smiley.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (52 views)
2014-04-15 18:08:23

BurntPizza (49 views)
2014-04-15 03:46:01

UprightPath (64 views)
2014-04-14 17:39:50

UprightPath (46 views)
2014-04-14 17:35:47

Porlus (63 views)
2014-04-14 15:48:38

tom_mai78101 (88 views)
2014-04-10 04:04:31

BurntPizza (147 views)
2014-04-08 23:06:04

tom_mai78101 (244 views)
2014-04-05 13:34:39

trollwarrior1 (203 views)
2014-04-04 12:06:45

CJLetsGame (210 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!