void () { try { final Writer out = result.getWriter(); if (out != null) { out.flush(); out.close(); } else if (result.getOutputStream() != null) { result.getOutputStream().flush(); result.getOutputStream().close(); } } catch (IOException e) { // no chance to fix... } }