我有一个byte[]
我想转换为图像并在标签中显示图像.byte []是jpeg 2000格式.我已经尝试了下面的代码,但它返回null:
InputStream in = new ByteArrayInputStream(bytearray);
BufferedImage image = ImageIO.read(in);
Run Code Online (Sandbox Code Playgroud)
图像值返回为null
.
我希望能够在如下标签中显示图像:
jLabel.setIcon(new ImageIcon(image));
Run Code Online (Sandbox Code Playgroud)
谢谢
如何在Java中将JPEG 2000转换为JPEG?我有一个生物识别系统,可以获取指纹和用户的ID号,并通过Web服务发送它以验证用户.如果用户已经过验证,我会以byte []的形式返回一个Image.现在我回来的字节[]是JPEG 2000,我需要在我的应用程序中显示它,但我需要显示一个jpeg.我需要知道如何将其转换为jpeg 2000.
谢谢.