public void deserialize(InputArchive archive, string tag) { archive.startRecord(tag); MultiHeader h = new MultiHeader(); ((Record)h).deserialize(archive, tag); while (!h.getDone()) { ZooDefs.OpCode opCode = EnumUtil <ZooDefs.OpCode> .DefinedCast(h.get_Type()); switch (opCode) { case ZooDefs.OpCode.create: CreateRequest cr = new CreateRequest(); ((Record)cr).deserialize(archive, tag); add(Op.create(cr.getPath(), cr.getData(), cr.getAcl(), cr.getFlags())); break; case ZooDefs.OpCode.delete: DeleteRequest dr = new DeleteRequest(); ((Record)dr).deserialize(archive, tag); add(Op.delete(dr.getPath(), dr.getVersion())); break; case ZooDefs.OpCode.setData: SetDataRequest sdr = new SetDataRequest(); ((Record)sdr).deserialize(archive, tag); add(Op.setData(sdr.getPath(), sdr.getData(), sdr.getVersion())); break; case ZooDefs.OpCode.check: CheckVersionRequest cvr = new CheckVersionRequest(); ((Record)cvr).deserialize(archive, tag); add(Op.check(cvr.getPath(), cvr.getVersion())); break; default: throw new IOException("Invalid type of op"); } ((Record)h).deserialize(archive, tag); } archive.endRecord(tag); }