I am trying to print bitmap image. In order to print image my printer needs byte array of bitmap. Picture size is 128x128 pixel.
Here is code how I read and convert image to byte array.
BufferedImage image = ImageIO.read(new File("test.bmp"));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(image, "bmp", baos);
byte[] imageInByte = baos.toByteArray();
System.out.println(imageInByte.length);
After code execution imageInByte array length is 2110. What am I missing here? Should not array length be 16384 (128 x 128)?