title: Java convert image to byte array size issues
body: <p>I have the below piece of code to convert an image to byte array.</p>
  
  <pre><code>ByteArrayOutputStream baos = new ByteArrayOutputStream();
  ImageIO.write(image, "png", baos);
  baos.flush();
  byte[] imageBytes = baos.toByteArray();
  baos.close();
  </code></pre>
  
  <p>The issue that I am facing is that the size of the image is around 2.65MB. However, imageBytes.length is giving me a value more than 5.5MB. Can somebody let me know where I am going wrong?</p>