byte—>BufferedImage

import javax.imageio.ImageIO

byte[] bytes = new byte[1024]
InputStream buffin = new ByteArrayInputStream(bytes)
BufferedImage bufferedImage = ImageIO.read(buffin)

byte与InputStream互转

//	byte---->InputStream
byte[] bytes = new byte[1024]
InputStream buffin = new ByteArrayInputStream(bytes)

//	InputStream--->byte
byte[] isToByte = org.apache.commons.io.IOUtils.toByteArray(buffin);
Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐