GZIPInputStream does not work with IOException in Android 2.3, but works fine in all previous releases?

Today I upgraded my phone to Gingerbread (2.3.2) and launched the application that I developed, and saw that it could not load its data. The app works fine on any other version of Android that I tested from 1.6 to 2.2, but then with an IOException in Gingerbread. Does anyone know if something has changed in GZipInputStream or URL.openStream ()?

The problematic code is similar to the following:

InputStream in = null;
GZIPInputStream zin = null;
URL url = null;
try {
    url = new URL("http://www.test.com/gzipped_data.gz");
    in = url.openStream();
    zin = new GZIPInputStream(in);
}
catch (MalformedURLException e) { 
    return false;
} 
catch (IOException e) {
    return false;
}

1.6 2.2 , 2.3 IOException . , - openStream, MIME- - . , openStream HTTP-, .

+5
1

. , Gingerbread (2.3) GZipped. " ", , openStream() GZipped . , GZIP , IOException.

. - HttpClient/HttpGet. , . , , . :

InputStream in = url.openStream();
GZIPInputStream zin;
try {
    zin = (GZIPInputStream)in;
} catch (Exception e) {
    zin = new GZIPInputStream(in);
}

Android , Android - . , .

, , , , GZIP. Android , :

http://code.google.com/p/android/issues/detail?id=16227

. .

+4

All Articles