In the following code, the close function for outPutStream throws an IOException, which I must catch. My question is do I need to handle this? Since I work with mobile devices, I want to make sure that I free up all the resources that I use, or whether I can safely ignore the exception.
OutputStream output = null;
try {
output = connection.getOutputStream();
output.write(query.getBytes(charset));
} finally {
if (output != null) try {
output.close();
} catch (IOException e) {
}
}
Jimmy source
share