zyrorl / sandrop

Automatically exported from code.google.com/p/sandrop
1 stars 0 forks source link

response content should be show as parsed (images , unzip zipped response, ...) #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
response content should be show as parsed (images , unzip zipped response, ...)

Original issue reported on code.google.com by supp.san...@gmail.com on 10 Jun 2012 at 5:21

GoogleCodeExporter commented 9 years ago
                // content is unzipped if Content-Encoding:gzip
                if (mhHaderCollection.containsKey("Content-Encoding")){
                    if (mhHaderCollection.get("Content-Encoding").equalsIgnoreCase("gzip")){
                        contentIsCompressed = true;
                    }
                }
                InputStream in = null;
                InputStream inProcessed = null;
                try {
                  in = new BufferedInputStream(new FileInputStream(mDataFile));
                  byte[] tempBuffer = new byte[headerSize];
                  in.read(tempBuffer);
                  if (contentIsCompressed){
                      try{
                          inProcessed = new GZIPInputStream(in);
                          BufferedReader brContent = new BufferedReader(new InputStreamReader(inProcessed, UTF8));
                          String contentLine;
                          while ((contentLine = brContent.readLine()) != null){
                              content.append(contentLine);
                          }
                      }catch(Exception ex){
                          if (LOGD) Log.e(TAG, "Error parsing " + ex.getMessage());
                          content.append("Error parsing content");
                      }
                  }else{
                      inProcessed = in;
                      BufferedReader brContent = new BufferedReader(new InputStreamReader(inProcessed, UTF8));
                      String contentLine;
                      while ((contentLine = brContent.readLine()) != null){
                          content.append(contentLine);
                      }
                  }
                }

Original comment by supp.san...@gmail.com on 12 Jun 2012 at 7:18

GoogleCodeExporter commented 9 years ago
how to show pictures?
maybe just use webview and provide content from some temp file containing 
response content...

Original comment by supp.san...@gmail.com on 14 Jun 2012 at 6:06

GoogleCodeExporter commented 9 years ago
showing pictures instead of binary data

Original comment by supp.san...@gmail.com on 14 Jun 2012 at 10:59

Attachments:

GoogleCodeExporter commented 9 years ago
version is on the market
maybe should also parse html 

Original comment by supp.san...@gmail.com on 17 Jun 2012 at 2:09