Hello !

Just in case somebody still uses the old code from SUN and tries to load
big (>1MB) gzip vrml files, I have a hint:

(all following is in the package com.sun.j3d.loaders.vrml97.impl)

Loader.java reads the incomming file byte by byte and there is a call to
ByteBuf.java.
To speed things up, one could simply increase the value for that buffer
(ie: from 1024 to 65536).


Another way is to add a line after "gis = new GZIPInputStream(is);"
(line 315)
which simply assigns the GZIPInput Stream gis to the InputStream is.
- > "is = gis;"

Then comment out the lines from "ByteBuf bb = new ByteBuf();" till
"is.reset();" - altogether 14 lines of code.

Doing this 2 changes bypasses the call to ByteBuf.java and reads a 3MB
file in 14 seconds (instead of 11 Minutes).

If anybody has a reason why the call of ByteBuf is necessary, tell me
please.

If anybody needs additional hints or needs the "patched" vrml97.jar,
feel free to contact me.

-Juergen.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to