示例#1
0
        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);
            }
        }
示例#2
0
 public TreeId ReadTreeId()
 {
     return(TreeId.FromStream(this));
 }