Changeset 4087 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2011-05-15T23:51:25+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r4069 r4087 7 7 import java.io.InputStream; 8 8 import java.io.OutputStream; 9 import java.io.Reader; 9 10 import java.text.MessageFormat; 10 11 import java.util.Collection; … … 202 203 return( path.delete() ); 203 204 } 205 206 /** 207 * <p>Utility method for closing an input stream.</p> 208 * 209 * @param is the input stream. May be null. 210 */ 211 public static void close(InputStream is){ 212 if (is == null) return; 213 try { 214 is.close(); 215 } catch(IOException e){ 216 // ignore 217 } 218 } 219 220 /** 221 * <p>Utility method for closing an output stream.</p> 222 * 223 * @param os the output stream. May be null. 224 */ 225 public static void close(OutputStream os){ 226 if (os == null) return; 227 try { 228 os.close(); 229 } catch(IOException e){ 230 // ignore 231 } 232 } 233 234 /** 235 * <p>Utility method for closing a reader.</p> 236 * 237 * @param reader the reader. May be null. 238 */ 239 public static void close(Reader reader){ 240 if (reader == null) return; 241 try { 242 reader.close(); 243 } catch(IOException e){ 244 // ignore 245 } 246 } 204 247 }
Note:
See TracChangeset
for help on using the changeset viewer.