aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/files/GPXImporter.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-05-11 08:56:34 +0200
committerBananeweizen <bananeweizen@gmx.de>2013-05-11 09:34:58 +0200
commitaea41c86f05d11828120fa71c0bcb5b1756061f1 (patch)
treeb2bb0ee0c681a838e1c22eb61885e2c1a5ca715e /main/src/cgeo/geocaching/files/GPXImporter.java
parentf3b65c3221d96bd431000b71bc8fb29a81c0eab9 (diff)
downloadcgeo-aea41c86f05d11828120fa71c0bcb5b1756061f1.zip
cgeo-aea41c86f05d11828120fa71c0bcb5b1756061f1.tar.gz
cgeo-aea41c86f05d11828120fa71c0bcb5b1756061f1.tar.bz2
#1348: use buffered io
Diffstat (limited to 'main/src/cgeo/geocaching/files/GPXImporter.java')
-rw-r--r--main/src/cgeo/geocaching/files/GPXImporter.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/files/GPXImporter.java b/main/src/cgeo/geocaching/files/GPXImporter.java
index ff81fe1..69d2dac 100644
--- a/main/src/cgeo/geocaching/files/GPXImporter.java
+++ b/main/src/cgeo/geocaching/files/GPXImporter.java
@@ -24,6 +24,7 @@ import android.net.Uri;
import android.os.Handler;
import android.os.Message;
+import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -287,7 +288,7 @@ public class GPXImporter {
Collection<Geocache> caches = Collections.emptySet();
// can't assume that GPX file comes before waypoint file in zip -> so we need two passes
// 1. parse GPX files
- ZipInputStream zis = new ZipInputStream(getInputStream());
+ ZipInputStream zis = new ZipInputStream(new BufferedInputStream(getInputStream()));
try {
for (ZipEntry zipEntry = zis.getNextEntry(); zipEntry != null; zipEntry = zis.getNextEntry()) {
if (StringUtils.endsWithIgnoreCase(zipEntry.getName(), GPX_FILE_EXTENSION)) {
@@ -305,7 +306,7 @@ public class GPXImporter {
}
// 2. parse waypoint files
- zis = new ZipInputStream(getInputStream());
+ zis = new ZipInputStream(new BufferedInputStream(getInputStream()));
try {
for (ZipEntry zipEntry = zis.getNextEntry(); zipEntry != null; zipEntry = zis.getNextEntry()) {
if (StringUtils.endsWithIgnoreCase(zipEntry.getName(), WAYPOINTS_FILE_SUFFIX_AND_EXTENSION)) {