こんな感じです。エラー発生時、fileDownload()がConnectionExceptionを投げてきます。

public int fileDownload(String url, int pos) throws Exception {
byte[] data = httpGet(url);
OutputStream out = Connector.openOutputStream("scratchpad:///0;pos=" + pos);
out.write(data);
out.flush();
out.close();
int ret = data.length;
data = null;
System.gc();
return ret;
}