我正在尝试将字节 [] 数组转换为缓冲图像,这样我就可以调整图像的大小..但问题是转换总是变成空值。这是我的代码..
ByteArrayInputStream bais = new ByteArrayInputStream(user.getUser_image());
//Here user.getUser_image() returns byte[] returned from server..
try {
BufferedImage image = ImageIO.read(bais);
System.out.println("============><================"+image);//Here it prints null
BufferedImage scaledImage = Scalr.resize(image,48);
}
.....and so on