public static Revision FromStream(ResponseBodyStream stream) { short ver = stream.ReadShort(); switch (ver) { case 0: return(new Revision()); case 1: return(new Revision(TreeId.FromStream(stream), stream.ReadULong())); case 2: return(new Revision(TreeId.FromStream(stream), stream.ReadULong())); case 3: return(new Revision(TreeId.FromStream(stream), stream.ReadULong(), TreeId.FromStream(stream), stream.ReadULong())); case 4: return(new Revision(TreeId.FromStream(stream), stream.ReadULong(), TreeId.FromStream(stream), stream.ReadULong())); case 5: return(new Revision(TreeId.FromStream(stream), stream.ReadULong(), TreeId.FromStream(stream))); //more revisions? default: throw new Exception("Unknown revision " + ver); } }
public TreeId ReadTreeId() { return(TreeId.FromStream(this)); }