static public boolean write(OutputStream os, CPArtwork a) {
		try {
			writeMagic(os);
			os.flush();

			Deflater def = new Deflater(7);
			DeflaterOutputStream dos = new DeflaterOutputStream(os, def);
			// OutputStream dos = os;

			writeHeader(dos, a);

			for (Object l : a.layers) {
				writeLayer(dos, (CPLayer) l);
			}

			writeEnd(dos);

			dos.flush();
			dos.close();
			return true;
		} catch (IOException e) {
			return false;
		}
	}