Android - skia解码图像错误

时间:2011-09-29 06:01:44

标签: android image skia

我一直在尝试按如下方式解码图像:

            String dat = jobJect.getString("dat");
            client = new DefaultHttpClient();
            String url2 = url1 + dat;
            request = new HttpGet(url2);
            request.setHeader("Cookie", "hcsid=" + GlobalConfig.hcSid);
            response = client.execute(request);
                            BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(
                    response.getEntity());
            InputStream im = bufHttpEntity.getContent();

                    OutputStream out = null;

                    final ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
                    out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE);
                    CameraActivity.copy(im, out);
                    out.flush();

                    final byte[] data = dataStream.toByteArray();
                    mBitMap = BitmapFactory.decodeByteArray(data, 0, data.length);

虽然我得到一张图片,但它没有被解码并抛出此错误:

09-29 11:27:38.675:DEBUG / skia(14907):--- decoder-> decode return false

我正在关注处理skia错误的代码: http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org/curiouscreature/android/shelves/util/ImageUtilities.java

但它没有解决问题。

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)