J
jonbbbb
Hello,
I was just wondering if there would be any suggestions for getting the
following scenario to run faster.
I have a program that loads some data from disk as a byte array.
This byte data is actually a quite large list of int that I want to
use.
So I first use read(byte[] b) to fill the byte array, then I fill the
int array by going through
the byte array and use some byte shifting to get 4 bytes to an int.
If this was a C program I could just read it as a byte array, and cast
it to a int array without
going through the painful loop of actually converting each int,
right?
I suppose there is no way around it in Java. Would it make sense to
write this as a C and
use JNI to get it back into Java. Any other ideas?
Thanks.
Regards,
Jon.
I was just wondering if there would be any suggestions for getting the
following scenario to run faster.
I have a program that loads some data from disk as a byte array.
This byte data is actually a quite large list of int that I want to
use.
So I first use read(byte[] b) to fill the byte array, then I fill the
int array by going through
the byte array and use some byte shifting to get 4 bytes to an int.
If this was a C program I could just read it as a byte array, and cast
it to a int array without
going through the painful loop of actually converting each int,
right?
I suppose there is no way around it in Java. Would it make sense to
write this as a C and
use JNI to get it back into Java. Any other ideas?
Thanks.
Regards,
Jon.