byte[] compressed = compress(data, 0, data.length);
Header header = new Header();
header.wmfsize = data.length;
//we don't have a EMF reader in java, have to set default image size 200x200
header.bounds = new java.awt.Rectangle(0, 0, 200, 200);
header.size = new java.awt.Dimension(header.bounds.width*Shape.EMU_PER_POINT, header.bounds.height*Shape.EMU_PER_POINT);
header.zipsize = compressed.length;
byte[] checksum = getChecksum(data);
ByteArrayOutputStream out = new ByteArrayOutputStream();
out.write(checksum);
header.write(out);
out.write(compressed);
setRawData(out.toByteArray());