title: Convert byte array (byte[]) to Image in Java
body: <p>I have a <code>byte[]</code> that I want to convert to an Image and display the image in a label.
  The byte[] is of a jpeg 2000 format.
  I have tried the code below but it returns null:</p>
  
  <pre><code>InputStream in = new ByteArrayInputStream(bytearray);
  BufferedImage image = ImageIO.read(in);
  </code></pre>
  
  <p>The image value comes back as <code>null</code>.</p>
  
  <p>I want to be able to display the image in a label like below:</p>
  
  <pre><code>jLabel.setIcon(new ImageIcon(image));
  </code></pre>
  
  <p>Thanks</p>