Hi all,

I'm writing some HTTP-code for mobile using J2ME, and I am experiecing some odd behaviour.
What I'm doing is downloading a file using HTTPConnection, and writing it to the file system using FileConnection.
While downloading, I interrupt the WIFI signal and it seems like no exception is thrown (IOException, anyone?), but instead an EOF is signaled (read method returns -1).
Is this normal behaviour? Any clarification would be much appreciated.

Code:
int bytesRead;
byte[] buffer = new byte[5000];
while((bytesRead = in.read(buffer)) != -1) {
    out.write(buffer, 0, bytesRead);
    System.out.println("-----------BUFFER WRITE");
}
System.out.println("-----------BEFORE FLUSH");
out.flush();
System.out.println("-----------AFTER FLUSH");
Thanks in advance.