Why did not you use NIO api for extract navite libs and other loading and sav

Why did not you use NIO api for extract navite libs and other loading and saving issues?

I guess this is the reason (if you can read german):

https://www.uni-koblenz.de/FB4/Institutes/IST/AGEbert/Teaching/WS0304/Program_WS0304/javanio-wloesch.pdf

Or in short faster, newer, better ,ect.

Yeah… Its just generally faster :wink:

Uh, no? I didn't use NIO, I used input/output streams. Look here:

http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/desktop/com/jme3/system/Natives.java#24

Also NIO are non-blocking calls, so you say write(X), it put X in a buffer and the rest of your code run while NIO save the data… very useful in asynchronous program (like network based program)

Ohh my good. I'm so sorry. Real Question is Why did not you use NIO api for extract navite libs and other loading and saving…

I suppose that can be done for the natives extraction to speed it up, but for loading/saving it is difficult because many parts of Java still use the streams. Also NIO is not useful if you're going to process the data using java since then you need it in array format.

Momoko_Fan said:

I suppose that can be done for the natives extraction to speed it up, but for loading/saving it is difficult because many parts of Java still use the streams. Also NIO is not useful if you're going to process the data using java since then you need it in array format.


Hmm, have you ever looked at the ByteBuffer? :D
Mikkel said:

Momoko_Fan said:

I suppose that can be done for the natives extraction to speed it up, but for loading/saving it is difficult because many parts of Java still use the streams. Also NIO is not useful if you're going to process the data using java since then you need it in array format.


Hmm, have you ever looked at the ByteBuffer? :D

Of course I did. ByteBuffer is used extensively to interface with OpenGL. The issue here is that doing any sort of Java processing on ByteBuffers is a lot slower than processing a byte array.

As far as i know this will change with the next java version however

Momoko_Fan said:

Mikkel said:

Momoko_Fan said:

I suppose that can be done for the natives extraction to speed it up, but for loading/saving it is difficult because many parts of Java still use the streams. Also NIO is not useful if you're going to process the data using java since then you need it in array format.


Hmm, have you ever looked at the ByteBuffer? :D

Of course I did. ByteBuffer is used extensively to interface with OpenGL. The issue here is that doing any sort of Java processing on ByteBuffers is a lot slower than processing a byte array.


Ah that way around - my bad. ;)
Actually a lot of the cool features Java has takes more time than it would if you simply used raw data types and common sense - which in unfortunate :(.

- Mikkel