(OutputStream out)
| 136 | /// |
| 137 | /// the writer |
| 138 | public static OutputStreamWriter getWriter(OutputStream out) { |
| 139 | try { |
| 140 | return new OutputStreamWriter(out, "UTF-8"); |
| 141 | } catch (UnsupportedEncodingException e) { |
| 142 | // never happens |
| 143 | throw new RuntimeException(e.toString(), e); |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | /// Copy the input stream into the output stream, closes both streams when finishing or in |
| 148 | /// a case of an exception |