def pack(self, s): fs = FakeWriteStream() self["content"].pack(fs) self["header"].data["length"] = fs.tell() Struct.pack(self, s)