]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/function/srtm/TileFinder.java
Version 15, March 2013
[GpsPrune.git] / tim / prune / function / srtm / TileFinder.java
index 209db7f58d439208caa363097236f40805957640..afcc28f274a2634b3bb74de613fa4cb653630a92 100644 (file)
@@ -54,10 +54,11 @@ public abstract class TileFinder
         */
        private static byte[] readDatFile()
        {
+               InputStream in = null;
                try
                {
                        // Need absolute path to dat file
-                       InputStream in = TileFinder.class.getResourceAsStream("/tim/prune/function/srtm/srtmtiles.dat");
+                       in = TileFinder.class.getResourceAsStream("/tim/prune/function/srtm/srtmtiles.dat");
                        if (in != null)
                        {
                                byte[] buffer = new byte[in.available()];
@@ -69,6 +70,13 @@ public abstract class TileFinder
                catch (java.io.IOException e) {
                        System.err.println("Exception trying to read srtmtiles.dat : " + e.getMessage());
                }
+               finally
+               {
+                       try {
+                               in.close();
+                       }
+                       catch (Exception e) {} // ignore
+               }
                return null;
        }
 }