Ignore:
Timestamp:
2011-05-15T23:51:25+02:00 (13 years ago)
Author:
bastiK
Message:

PaintVisitor refactoring, includes hook for external MapRenderers (author: Gubaer)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r4069 r4087  
    77import java.io.InputStream;
    88import java.io.OutputStream;
     9import java.io.Reader;
    910import java.text.MessageFormat;
    1011import java.util.Collection;
     
    202203        return( path.delete() );
    203204    }
     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    }
    204247}
Note: See TracChangeset for help on using the changeset viewer.