It may depend on your code.
Reading one byte at a time tends to be really slow on some devices.
Code:
public static byte[] read(InputStream in, int contentLength) throws IOException {
byte[] b = new byte[contentLength];
for (int i = 0; i < contentLength; i++) {
// don't do this! Slow!!
b[i] = (byte)in.read();
}
return b;
}
Reading into an array is much better. Note that you can't just call read() and expect everything to be OK. You must check the return value to see how many bytes were actually read.
Code:
public static byte[] read(InputStream in, int contentLength) throws IOException {
byte[] b = new byte[contentLength];
int readSoFar = 0;
while (readSoFar < contentLength) {
readSoFar += in.read(b, readSoFar, contentLength - readSoFar);
}
return b;
}
I'm surprised this would make S60's slower, but if you're using code like the first example, you should definitely switch.
(The same applies to reading resource files from the JAR.)
Cheers,
Graham.