bitmap转成字节流

来源:互联网 发布:阿里云个人邮箱登录 编辑:程序博客网 时间:2024/06/10 19:56


public InputStream bitmapToInputStream(Bitmap myBitmap) {
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  myBitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
  ByteArrayInputStream byteArrInputStream = new ByteArrayInputStream(
    baos.toByteArray());

  return byteArrInputStream;
 }

0 0
原创粉丝点击