title: Why do I get an IOException: CRC Mismatch on Android 2.3 devices and not 2.2 while parsing json from a URL?
body: <p>What I'm trying to do is get some json results back from a URL using a Bufferedreader which uses a inputstreamreader. I read each line and for each JSONObject i get properties and do awesome things with them later.</p>
  
  <p>Anyway, on Android 2.2 the code works fine but when i test on a 2.3 device (emulated, stock, or custom rom alike) i get this exception:</p>
  
  <pre><code>06-22 15:33:13.958: ERROR/App(416): IOException
  06-22 15:33:13.958: ERROR/App(416): java.io.IOException: CRC mismatch
  06-22 15:33:13.958: ERROR/App(416):     at java.util.zip.GZIPInputStream.verifyCrc(GZIPInputStream.java:201)
  06-22 15:33:13.958: ERROR/App(416):     at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:184)
  06-22 15:33:13.958: ERROR/App(416):     at java.io.InputStreamReader.read(InputStreamReader.java:255)
  06-22 15:33:13.958: ERROR/App(416):     at java.io.BufferedReader.fillBuf(BufferedReader.java:128)
  06-22 15:33:13.958: ERROR/App(416):     at java.io.BufferedReader.readLine(BufferedReader.java:357)
  06-22 15:33:13.958: ERROR/App(416):     at ca.bnotions.App.Places.fetchData(Places.java:57)
  06-22 15:33:13.958: ERROR/App(416):     at ca.bnotions.App.Places.onCreate(Places.java:40)
  06-22 15:33:13.958: ERROR/App(416):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  06-22 15:33:13.958: ERROR/App(416):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
  06-22 15:33:13.958: ERROR/App(416):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
  06-22 15:33:13.958: ERROR/App(416):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  06-22 15:33:13.958: ERROR/App(416):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
  06-22 15:33:13.958: ERROR/App(416):     at android.os.Handler.dispatchMessage(Handler.java:99)
  06-22 15:33:13.958: ERROR/App(416):     at android.os.Looper.loop(Looper.java:123)
  06-22 15:33:13.958: ERROR/App(416):     at android.app.ActivityThread.main(ActivityThread.java:3683)
  06-22 15:33:13.958: ERROR/App(416):     at java.lang.reflect.Method.invokeNative(Native Method)
  06-22 15:33:13.958: ERROR/App(416):     at java.lang.reflect.Method.invoke(Method.java:507)
  06-22 15:33:13.958: ERROR/App(416):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  06-22 15:33:13.958: ERROR/App(416):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  06-22 15:33:13.958: ERROR/App(416):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Here is the code I'm using:</p>
  
  <pre><code>public ArrayList&lt;String&gt; fetchData()
      {
          list_items = new ArrayList&lt;String&gt;();
          try {
              URL places_data = new URL("http://myurl.com");
              URLConnection tc = places_data.openConnection();
              BufferedReader in = new BufferedReader(new InputStreamReader(tc.getInputStream()));
              String line;
              while ((line = in.readLine()) != null) {
                  JSONArray ja = new JSONArray(line);
  
                  for (int i = 0; i &lt; ja.length(); i++) {
                      JSONObject jo = (JSONObject) ja.get(i);
                      list_items.add(jo.getString("name"));
                  }
              }
          } catch (MalformedURLException e) {
              Log.e("MyApp","MalformedURLException",e);
          } catch (IOException e) {
              Log.e("MyApp","IOException",e);
          } catch (JSONException e) {
              Log.e("MyApp","JSONException",e);
          }
  
          return list_items;
      }
  </code></pre>
  
  <p>Any insight would be greatly appreciated.</p>
  
  <p>Thanks,</p>
  
  <p>Marcus</p>