The exception should give you line numbers, so you should be able to figure out what line in which file is generating the exception. You might also try something like:
Code:
try {
  i=0;
  while ((image[i++] = dataconn.data_reader.readByte()) != -1) {
	// Read data in while it's not EOS
  }
} catch (Exception e) {
  System.out.println("Exception Thrown: "+ e.getClass().getName() +");
  System.err.println("Exception: " + e.getMessage());
}