public byte[] Rebuild() { OutputBuffer o = new OutputBuffer(); // TODO: write correct filesize in header. // It isn't checked by the game, but what the hell, right? header.Write(o); writeSymbols(o); writeColors(o); writeTransforms(o); writePositions(o); writeExtents(o); actionscript.Write(o); writeAtlases(o); unkF008.Write(o); unkF009.Write(o); unkF00A.Write(o); unk000A.Write(o); unkF00B.Write(o); properties.Write(o); unkF00D.Write(o); writeShapes(o); writeMovieClips(o); writeTexts(o); //metadata.Write(o); o.writeInt((int)TagType.End); o.writeInt(0); int padSize = (4 - (o.Size % 4)) % 4; for (int i = 0; i < padSize; i++) { o.writeByte(0); } return(o.getBytes()); }