如何从S3Object获取BufferedImage?我猜想我会想念ImageIO读卡器吗?!这是我试过的。它抛出NullPointerException:
S3Object o = s3Client.getObject("testbucket", "test.jpeg");
logger.debug(o.getObjectMetadata().getContentLength()); // 25890
logger.debug(o.getObjectMetadata().getContentType()); // image/jpeg
ImageInputStream iin = ImageIO.createImageInputStream(o.getObjectContent());
BufferedImage img = ImageIO.read(iin);
logger.debug(img.getHeight()); // NullPointerException
感谢您的帮助!