Skip to content

Commit

Permalink
Merge pull request #59 from mgcuthbert/master
Browse files Browse the repository at this point in the history
Removing MultiMemberGZIPInputStream
  • Loading branch information
migurski authored Mar 24, 2020
2 parents 10e7984 + 7c47e5b commit 768aeea
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 142 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
import org.openstreetmap.osmosis.core.lifecycle.Completable;
import org.openstreetmap.osmosis.core.lifecycle.ReleasableIterator;
import org.openstreetmap.osmosis.core.util.MultiMemberGZIPInputStream;


/**
Expand Down Expand Up @@ -274,7 +274,7 @@ public ReleasableIterator<T> iterate(long streamOffset, long maxObjectCount) {
if (useCompression) {
dataInStream = new DataInputStream(
new BufferedInputStream(
new MultiMemberGZIPInputStream(fileStream), 65536));
new GZIPInputStream(fileStream), 65536));
} else {
dataInStream = new DataInputStream(new BufferedInputStream(fileStream, 65536));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
import org.openstreetmap.osmosis.core.lifecycle.Completable;
import org.openstreetmap.osmosis.core.lifecycle.ReleasableIterator;
import org.openstreetmap.osmosis.core.util.MultiMemberGZIPInputStream;


/**
* Provides a store for writing objects to a file for later retrieval. The
Expand Down Expand Up @@ -173,7 +172,7 @@ public ReleasableIterator<T> iterate() {
try {
if (useCompression) {
dataInStream = new DataInputStream(
new BufferedInputStream(new MultiMemberGZIPInputStream(fileStream), 65536));
new BufferedInputStream(new GZIPInputStream(fileStream), 65536));
} else {
dataInStream = new DataInputStream(
new BufferedInputStream(fileStream, 65536));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream;

import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
import org.openstreetmap.osmosis.core.util.MultiMemberGZIPInputStream;


/**
Expand Down Expand Up @@ -85,7 +85,7 @@ public InputStream createCompressionInputStream(InputStream sourceStream) {
}

if (CompressionMethod.GZip.equals(compressionMethod)) {
return new MultiMemberGZIPInputStream(sourceStream);
return new GZIPInputStream(sourceStream);
}

if (CompressionMethod.BZip2.equals(compressionMethod)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Collections;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.GZIPInputStream;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;

Expand All @@ -24,7 +25,6 @@
import org.openstreetmap.osmosis.core.domain.v0_6.Bound;
import org.openstreetmap.osmosis.core.task.v0_6.RunnableSource;
import org.openstreetmap.osmosis.core.task.v0_6.Sink;
import org.openstreetmap.osmosis.core.util.MultiMemberGZIPInputStream;
import org.openstreetmap.osmosis.xml.v0_6.impl.OsmHandler;
import org.openstreetmap.osmosis.xml.v0_6.impl.XmlConstants;

Expand Down Expand Up @@ -265,7 +265,7 @@ private InputStream getInputStream(final String pUrlStr) throws IOException {

responseStream = myActiveConnection.getInputStream();
if (encoding != null && encoding.equalsIgnoreCase("gzip")) {
responseStream = new MultiMemberGZIPInputStream(responseStream);
responseStream = new GZIPInputStream(responseStream);
} else if (encoding != null && encoding.equalsIgnoreCase("deflate")) {
responseStream = new InflaterInputStream(responseStream, new Inflater(true));
}
Expand Down

0 comments on commit 768aeea

Please sign in to comment.