如何将ByteArrayInputStream转换为文件或图像

时间:2018-12-10 09:53:15

标签: scala playframework

我有这个代码

def test(base64:String){     Logger.debug(“ ImageHelper.test”)

var test = Base64.getDecoder.decode(base64);   

// var input_stream: ByteArrayInputStream = new ByteArrayInputStream(test);
var input_stream = new ByteArrayInputStream(test);

// var final_buffered_image: BufferedImage = ImageIO.read(input_stream);

// ImageIO.write(final_buffered_image , "jpg", new File("final_file.jpg") );

    val size100     = Image.fromStream(new FileInputStream(base64)).scaleTo(100, 100)
// val size100   = Image.fromStream(input_stream).scaleTo(100, 100) }

如何将input_stream变量(哪个是ByteArrayInputStream)转换为文件或图像?

0 个答案:

没有答案