JAVA中BufferedImage与byte[]转换
BufferedImage转byte[]
ByteArrayOutputStream out = new ByteArrayOutputStream(); ImageIO.write(imgBuff, "jpeg", out); byte[] bytes=out.toByteArray();
byte[]转BufferedImage
ByteArrayInputStream in = new ByteArrayInputStream(bytes); BufferedImage srcBuff = ImageIO.read(in);
-----------------------有任何问题可以在评论区评论,也可以私信我,我看到的话会进行回复,欢迎大家指教------------------------
(蓝奏云官网有些地址失效了,需要把请求地址lanzous改成lanzoux才可以)