Convert InputStream(Image) to ByteArrayInputStream

后端 未结 3 727
抹茶落季
抹茶落季 2020-12-14 02:02

Not sure about how I am supposed to do this. Any help would be appreciated

3条回答
  •  既然无缘
    2020-12-14 02:40

    You can use org.apache.commons.io.IOUtils#toByteArray(java.io.InputStream)

    InputStream is = getMyInputStream();
    ByteArrayInputStream bais = new ByteArrayInputStream(IOUtils.toByteArray(is));
    

提交回复
热议问题