In the following code the close function for outPutStream throw an IOException exception that I should catch. My question is do I need to handle it? Since I'm working with mobile devices and I want to make sure that I free all resources that I use, or could I 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) {
// Do i need to do something here ?
}
}