diff --git a/src/com/vividsolutions/jump/coordsys/EsriProj.java b/src/com/vividsolutions/jump/coordsys/EsriProj.java index e971c798e..bb0863ab6 100644 --- a/src/com/vividsolutions/jump/coordsys/EsriProj.java +++ b/src/com/vividsolutions/jump/coordsys/EsriProj.java @@ -76,8 +76,9 @@ public static String findProj(final int id) throws IOException, ArchiveException String proj = PROJMAP.get(id); if (proj == null) proj = PROJMAP.get(id); if (proj == null) { - InputStream fis = new FileInputStream(projfile); - InputStream is = CompressedFile.getUncompressedStream(fis, entryName); + //InputStream fis = new FileInputStream(projfile); + //InputStream is = CompressedFile.getUncompressedStream(fis, entryName); + InputStream is = CompressedFile.openFile(projfile.getPath(), entryName); BufferedReader br = new BufferedReader(new InputStreamReader(is)); Optional tokens = br.lines() diff --git a/src/com/vividsolutions/jump/io/CompressedFile.java b/src/com/vividsolutions/jump/io/CompressedFile.java index 3c064cbfb..48a689ad0 100644 --- a/src/com/vividsolutions/jump/io/CompressedFile.java +++ b/src/com/vividsolutions/jump/io/CompressedFile.java @@ -280,32 +280,6 @@ else if (isSevenZ(filePath)) { } - /** - * Returns an uncompressed stream from a compressed stream and an entry name. - * This is a part of openFile method you can use if you know your input is - * compressed with the following benefits : - * - * - * @param is input stream containing compressed data (from URL, jar, file...) - * @param entryName entry name in the compressed stream - * @return uncompressed inputstream for the entry - * @throws IOException if the input stream cannot be read - * @throws ArchiveException if an exception occurs during decompression - */ - public static InputStream getUncompressedStream(InputStream is, String entryName) throws IOException, ArchiveException { - InputStream bis = is instanceof FilterInputStream ? is : new BufferedInputStream(is); - ArchiveInputStream ais = new ArchiveStreamFactory().createArchiveInputStream(bis); - ArchiveEntry entry; - while ((entry = ais.getNextEntry()) != null) { - if (entry.getName().equals(entryName)) - return ais; - } - bis.close(); - return null; - } public static boolean isCompressed(URI uri) { String filepath = UriUtil.getFilePath(uri);