SkImageDecoder :: Factory在CopyStream之后返回null ...

时间:2015-02-06 01:22:04

标签: java android

我有以下代码情况:

处理并返回InputStream

中的位图图像的函数

这里的一切都很好

private Bitmap loadBitmap(InputStrean is)
{
.....
.....

return BitmapFactory.decodeStream(is, null, o);
}

在上次发言之前,我想复制该流

private Bitmap loadBitmap(InputStrean is)
{
.....
.....

CopyStream(is, os);

return BitmapFactory.decodeStream(is, null, o);
}

导致以下错误 “SkImageDecoder :: Factory返回null”

public static void CopyStream(InputStream is, OutputStream os)
{
final int buffer_size=1024;
try
    {
        byte[] bytes=new byte[buffer_size];
        for(;;)
        {
          int count=is.read(bytes, 0, buffer_size);
          if(count==-1)
              break;
          os.write(bytes, 0, count);
        }
    }
    catch(Exception ex){}
}

InputStream不会改变但是......他可能错了吗?

0 个答案:

没有答案