Ignore:
Timestamp:
2017-09-07T21:24:42+02:00 (2 years ago)
Author:
bastiK
Message:

see #15229 - move compression methods from Utils to Compression

File:
1 edited

Legend:

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

    r12703 r12772  
    5858import java.util.stream.Stream;
    5959import java.util.zip.GZIPInputStream;
    60 import java.util.zip.ZipEntry;
    6160import java.util.zip.ZipFile;
    6261import java.util.zip.ZipInputStream;
     
    7170import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
    7271import org.openstreetmap.josm.Main;
     72import org.openstreetmap.josm.io.Compression;
    7373import org.w3c.dom.Document;
    7474import org.xml.sax.InputSource;
     
    727727     * @throws IOException if the given input stream does not contain valid BZ2 header
    728728     * @since 7867
    729      */
     729     * @deprecated use {@link Compression#getBZip2InputStream(java.io.InputStream)}
     730     */
     731    @Deprecated
    730732    public static BZip2CompressorInputStream getBZip2InputStream(InputStream in) throws IOException {
    731         if (in == null) {
    732             return null;
    733         }
    734         return new BZip2CompressorInputStream(in, /* see #9537 */ true);
     733        return Compression.getBZip2InputStream(in);
    735734    }
    736735
     
    741740     * @throws IOException if an I/O error has occurred
    742741     * @since 7119
    743      */
     742     * @deprecated use {@link Compression#getGZipInputStream(java.io.InputStream)}
     743     */
     744    @Deprecated
    744745    public static GZIPInputStream getGZipInputStream(InputStream in) throws IOException {
    745         if (in == null) {
    746             return null;
    747         }
    748         return new GZIPInputStream(in);
     746        return Compression.getGZipInputStream(in);
    749747    }
    750748
     
    755753     * @throws IOException if an I/O error has occurred
    756754     * @since 7119
    757      */
     755     * @deprecated use {@link Compression#getZipInputStream(java.io.InputStream)}
     756     */
     757    @Deprecated
    758758    public static ZipInputStream getZipInputStream(InputStream in) throws IOException {
    759         if (in == null) {
    760             return null;
    761         }
    762         ZipInputStream zis = new ZipInputStream(in, StandardCharsets.UTF_8);
    763         // Positions the stream at the beginning of first entry
    764         ZipEntry ze = zis.getNextEntry();
    765         if (ze != null && Logging.isDebugEnabled()) {
    766             Logging.debug("Zip entry: {0}", ze.getName());
    767         }
    768         return zis;
     759        return Compression.getZipInputStream(in);
    769760    }
    770761
Note: See TracChangeset for help on using the changeset viewer.