2.2.1.1 Compact Unsigned 64-bit Integer
상속: BaseStructure
        /// <summary>
        /// Parse the bit32StreamObjectHeaderStart structure.
        /// </summary>
        /// <param name="s">An stream containing bit32StreamObjectHeaderStart structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            int index = 0;
            int temp = ReadINT32();
            this.A = (byte)GetBits(temp, index, 2);
            index = index + 2;
            this.B = (byte)GetBits(temp, index, 1);
            index = index + 1;
            this.Type = (StreamObjectTypeHeaderStart)GetBits(temp, index, 14);
            index = index + 14;
            this.Length = (byte)GetBits(temp, index, 15);

            if (this.Length == 32767)
            {
                this.LargeLength = new CompactUnsigned64bitInteger();
                this.LargeLength = this.LargeLength.TryParse(s);
            }
        }
 /// <summary>
 /// Parse the CellManifestDataElement structure.
 /// </summary>
 /// <param name="s">An stream containing CellManifestDataElement structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.DataElementStart = new bit16StreamObjectHeaderStart();
     this.DataElementStart.Parse(s);
     this.DataElementExtendedGUID = new ExtendedGUID();
     this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
     this.SerialNumber = new SerialNumber();
     this.SerialNumber = this.SerialNumber.TryParse(s);
     this.DataElementType = new CompactUnsigned64bitInteger();
     this.DataElementType = this.DataElementType.TryParse(s);
     this.CellManifestCurrentRevision = new bit16StreamObjectHeaderStart();
     this.CellManifestCurrentRevision.Parse(s);
     this.CellManifestCurrentRevisionExtendedGUID = new ExtendedGUID();
     this.CellManifestCurrentRevisionExtendedGUID = this.CellManifestCurrentRevisionExtendedGUID.TryParse(s);
     this.DataElementEnd = new bit8StreamObjectHeaderEnd();
     this.DataElementEnd.Parse(s);
 }
        /// <summary>
        /// Parse the WaterlineKnowledgeEntry structure.
        /// </summary>
        /// <param name="s">An stream containing WaterlineKnowledgeEntry structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.waterlineKnowledgeEntry = new bit16StreamObjectHeaderStart();
            this.waterlineKnowledgeEntry.Parse(s);
            this.CellStorageExtendedGUID = new ExtendedGUID();
            this.CellStorageExtendedGUID = this.CellStorageExtendedGUID.TryParse(s);

            this.Waterline = new CompactUnsigned64bitInteger();
            this.Waterline = this.Waterline.TryParse(s);
            this.Reserved = new CompactUnsigned64bitInteger();
            this.Reserved = this.Reserved.TryParse(s);
        }
 /// <summary>
 /// Parse the AllocateExtendedGUIDRangeRequest structure.
 /// </summary>
 /// <param name="s">An stream containing AllocateExtendedGUIDRangeRequest structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.allocateExtendedGUIDRangeRequest = new bit32StreamObjectHeaderStart();
     this.allocateExtendedGUIDRangeRequest.Parse(s);
     this.RequestIdCount = new CompactUnsigned64bitInteger();
     this.RequestIdCount = this.RequestIdCount.TryParse(s);
     this.Reserved = ReadByte();
 }
        /// <summary>
        /// Parse the StorageIndexDataElement structure.
        /// </summary>
        /// <param name="s">An stream containing StorageIndexDataElement structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.DataElementStart = new bit16StreamObjectHeaderStart();
            this.DataElementStart.Parse(s);
            this.DataElementExtendedGUID = new ExtendedGUID();
            this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
            this.SerialNumber = new SerialNumber();
            this.SerialNumber = this.SerialNumber.TryParse(s);
            this.DataElementType = new CompactUnsigned64bitInteger();
            this.DataElementType = this.DataElementType.TryParse(s);

            int StorageIndexType = (CurrentByte() >> 3) & 0x3F;
            List<object> DataList = new List<object>();
            while ((CurrentByte() & 0x03) == 0x0 && (StorageIndexType == 0x11 || StorageIndexType == 0x0E || StorageIndexType == 0x0D))
            {
                switch (StorageIndexType)
                {
                    case 0x11:
                        StorageIndexManifestMappingValues ManifestMappingValue = new StorageIndexManifestMappingValues();
                        ManifestMappingValue.Parse(s);
                        DataList.Add(ManifestMappingValue);
                        break;
                    case 0x0E:
                        StorageIndexCellMappingValues CellMappingValue = new StorageIndexCellMappingValues();
                        CellMappingValue.Parse(s);
                        DataList.Add(CellMappingValue);
                        break;
                    case 0x0D:
                        StorageIndexRevisionMappingValues RevisionMappingValue = new StorageIndexRevisionMappingValues();
                        RevisionMappingValue.Parse(s);
                        DataList.Add(RevisionMappingValue);
                        break;
                    default:
                        throw new Exception("The StorageIndexType is not right.");
                }
                StorageIndexType = (CurrentByte() >> 3) & 0x3F;
            }
            this.StorageIndexDataElementData = DataList.ToArray();
            this.DataElementEnd = new bit8StreamObjectHeaderEnd();
            this.DataElementEnd.Parse(s);
        }
 /// <summary>
 /// get Uint feild in StreamObjectHeader structure.
 /// </summary>
 /// <returns>The value of Uint feild</returns>
 public ulong GetUint(CompactUnsigned64bitInteger objectVal)
 {
     if (objectVal is CompactUintZero)
     {
         return (objectVal as CompactUintZero).Uint;
     }
     else if (objectVal is CompactUint7bitvalues)
     {
         return (objectVal as CompactUint7bitvalues).Uint;
     }
     else if (objectVal is CompactUint14bitvalues)
     {
         return (objectVal as CompactUint14bitvalues).Uint;
     }
     else if (objectVal is CompactUint21bitvalues)
     {
         return (objectVal as CompactUint21bitvalues).Uint;
     }
     else if (objectVal is CompactUint28bitvalues)
     {
         return (objectVal as CompactUint28bitvalues).Uint;
     }
     else if (objectVal is CompactUint35bitvalues)
     {
         return (objectVal as CompactUint35bitvalues).Uint;
     }
     else if (objectVal is CompactUint42bitvalues)
     {
         return (objectVal as CompactUint42bitvalues).Uint;
     }
     else if (objectVal is CompactUint49bitvalues)
     {
         return (objectVal as CompactUint49bitvalues).Uint;
     }
     else if (objectVal is CompactUint64bitvalues)
     {
         return (objectVal as CompactUint64bitvalues).Uint;
     }
     else
     {
         throw new Exception("The CompactUnsigned64bitInteger type is not right.");
     }
 }
        /// <summary>
        /// Parse the FragmentKnowledgeEntry structure.
        /// </summary>
        /// <param name="s">An stream containing FragmentKnowledgeEntry structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.FragmentDescriptor = new bit32StreamObjectHeaderStart();
            this.FragmentDescriptor.Parse(s);
            this.ExtendedGUID = new ExtendedGUID();
            this.ExtendedGUID = this.ExtendedGUID.TryParse(s);

            this.DataElementSize = new CompactUnsigned64bitInteger();
            this.DataElementSize = this.DataElementSize.TryParse(s);
            this.DataElementChunkReference = new FileChunkReference();
            this.DataElementChunkReference.Parse(s);
        }
        /// <summary>
        /// Parse the Filter structure.
        /// </summary>
        /// <param name="s">An stream containing Filter structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.queryChangesRequest = new bit32StreamObjectHeaderStart();
            this.queryChangesRequest.Parse(s);
            byte tempByte = ReadByte();
            this.A = GetBits(tempByte, 0, 1);
            this.B = GetBits(tempByte, 1, 1);
            this.C = GetBits(tempByte, 2, 1);
            this.D = GetBits(tempByte, 3, 1);
            this.E = GetBits(tempByte, 4, 1);
            this.F = GetBits(tempByte, 5, 1);
            this.G = GetBits(tempByte, 6, 2);
            this.queryChangesRequestArguments = new bit32StreamObjectHeaderStart();
            this.queryChangesRequestArguments.Parse(s);
            byte tempByte2 = ReadByte();
            this.F2 = GetBits(tempByte2, 0, 1);
            this.G2 = GetBits(tempByte2, 1, 1);
            this.H = GetBits(tempByte2, 2, 6);
            this.CellID = new CellID();
            this.CellID.Parse(s);
            if (ContainsStreamObjectHeader(0x059))
            {
                this.QueryChangesDataConstraints = new bit32StreamObjectHeaderStart();
                this.QueryChangesDataConstraints.Parse(s);
            }
            if (this.QueryChangesDataConstraints != null)
            {
                this.MaxDataElements = new CompactUnsigned64bitInteger();
                this.MaxDataElements = this.MaxDataElements.TryParse(s);
            }

            //TODO£ºThe below two fields are newly add in TD, but they have not conatined in the capture data for sharepoint 2013 server
            //this.MajorVersionNumber = new CompactUnsigned64bitInteger();
            //this.MajorVersionNumber = this.MajorVersionNumber.TryParse(s);
            //this.MinorVersionNumber = new CompactUnsigned64bitInteger();
            //this.MinorVersionNumber = this.MinorVersionNumber.TryParse(s);
            List<Filter> FilterList = new List<Filter>();
            while (ContainsStreamObjectHeader(0x47))
            {
                Filter tempFilter = new Filter();
                FilterList.Add(tempFilter);
            }
            this.QueryChangesFilters = FilterList.ToArray();

            if (ContainsStreamObjectHeader(0x10))
            {
                this.Knowledge = new Knowledge();
                this.Knowledge.Parse(s);
            }
        }
 /// <summary>
 /// Parse the DataElementTypeFilter structure.
 /// </summary>
 /// <param name="s">An stream containing DataElementTypeFilter structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.QueryChangesFilterDataElementType = new bit32StreamObjectHeaderStart();
     this.QueryChangesFilterDataElementType.Parse(s);
     this.DataElementType = new CompactUnsigned64bitInteger();
     this.DataElementType = this.DataElementType.TryParse(s);
 }
 /// <summary>
 /// Parse the FileChunkReference structure.
 /// </summary>
 /// <param name="s">An stream containing FileChunkReference structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.Start = new CompactUnsigned64bitInteger();
     this.Start = this.Start.TryParse(s);
     this.Length = new CompactUnsigned64bitInteger();
     this.Length = this.Length.TryParse(s);
 }
 /// <summary>
 /// Parse the DataElementHash structure.
 /// </summary>
 /// <param name="s">An stream containing DataElementHash structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.DataElementHashDeclaration = new StreamObjectHeader();
     this.DataElementHashDeclaration = this.DataElementHashDeclaration.TryParse(s);
     this.DataElementHashScheme = new CompactUnsigned64bitInteger();
     this.DataElementHashScheme = this.DataElementHashScheme.TryParse(s);
     this.DataElementHashData = new BinaryItem();
     this.DataElementHashData.Parse(s);
 }
 /// <summary>
 /// Parse the DataElementFragmentDataElement structure.
 /// </summary>
 /// <param name="s">An stream containing DataElementFragmentDataElement structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.DataElementStart = new bit16StreamObjectHeaderStart();
     this.DataElementStart.Parse(s);
     this.DataElementExtendedGUID = new ExtendedGUID();
     this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
     this.SerialNumber = new SerialNumber();
     this.SerialNumber = this.SerialNumber.TryParse(s);
     this.DataElementType = new CompactUnsigned64bitInteger();
     this.DataElementType = this.DataElementType.TryParse(s);
     this.DataElementFragment = new bit32StreamObjectHeaderStart();
     this.DataElementFragment.Parse(s);
     this.FragmentExtendedGUID = new ExtendedGUID();
     this.FragmentExtendedGUID = this.FragmentExtendedGUID.TryParse(s);
     this.FragmentDataElementSize = new CompactUnsigned64bitInteger();
     this.FragmentDataElementSize = this.FragmentDataElementSize.TryParse(s);
     this.FragmentFileChunkReference = new FileChunkReference();
     this.FragmentFileChunkReference.Parse(s);
     this.FragmentData = new BinaryItem();
     this.FragmentData.Parse(s);
     this.DataElementEnd = new bit8StreamObjectHeaderEnd();
     this.DataElementEnd.Parse(s);
 }
 /// <summary>
 /// Parse the CompactUnsigned64bitInteger structure.
 /// </summary>
 /// <param name="s">An stream containing CompactUnsigned64bitInteger structure.</param>
 public CompactUnsigned64bitInteger TryParse(Stream s)
 {
     base.Parse(s);
     byte temp = ReadByte();
     s.Position -= 1;
     CompactUnsigned64bitInteger compactUint64 = new CompactUnsigned64bitInteger();
     if (temp == 0x0)
     {
         compactUint64 = new CompactUintZero();
         compactUint64.Parse(s);
     }
     else if ((temp & 0x01) == 0x01)
     {
         compactUint64 = new CompactUint7bitvalues();
         compactUint64.Parse(s);
     }
     else if ((temp & 0x03) == 0x02)
     {
         compactUint64 = new CompactUint14bitvalues();
         compactUint64.Parse(s);
     }
     else if ((temp & 0x07) == 0x04)
     {
         compactUint64 = new CompactUint21bitvalues();
         compactUint64.Parse(s);
     }
     else if ((temp & 0x0F) == 0x08)
     {
         compactUint64 = new CompactUint28bitvalues();
         compactUint64.Parse(s);
     }
     else if ((temp & 0x1F) == 0x10)
     {
         compactUint64 = new CompactUint35bitvalues();
         compactUint64.Parse(s);
     }
     else if ((temp & 0x3F) == 0x20)
     {
         compactUint64 = new CompactUint42bitvalues();
         compactUint64.Parse(s);
     }
     else if ((temp & 0x7F) == 0x40)
     {
         compactUint64 = new CompactUint49bitvalues();
         compactUint64.Parse(s);
     }
     else if (temp == 0x80)
     {
         compactUint64 = new CompactUint64bitvalues();
         compactUint64.Parse(s);
     }
     return compactUint64;
 }
        /// <summary>
        /// Parse the ObjectGroupDataElements structure.
        /// </summary>
        /// <param name="s">An stream containing ObjectGroupDataElements structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.DataElementStart = new bit16StreamObjectHeaderStart();
            this.DataElementStart.Parse(s);
            this.DataElementExtendedGUID = new ExtendedGUID();
            this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
            this.SerialNumber = new SerialNumber();
            this.SerialNumber = this.SerialNumber.TryParse(s);
            this.DataElementType = new CompactUnsigned64bitInteger();
            this.DataElementType = this.DataElementType.TryParse(s);

            if (ContainsStreamObjectHeader(0x06))
            {
                this.DataElementHash = new DataElementHash();
                this.DataElementHash.Parse(s);
            }
            this.ObjectGroupDeclarationsStart = new StreamObjectHeader();
            this.ObjectGroupDeclarationsStart = this.ObjectGroupDeclarationsStart.TryParse(s);

            List<object> DeclarationList = new List<object>();
            while (ContainsStreamObjectHeader(0x18) || ContainsStreamObjectHeader(0x05))
            {
                if (ContainsStreamObjectHeader(0x18))
                {
                    ObjectDeclaration Declaration = new ObjectDeclaration();
                    Declaration.Parse(s);
                    DeclarationList.Add(Declaration);
                }
                else if (ContainsStreamObjectHeader(0x05))
                {
                    ObjectDataBLOBDeclaration DeclarationBLOB = new ObjectDataBLOBDeclaration();
                    DeclarationBLOB.Parse(s);
                    DeclarationList.Add(DeclarationBLOB);
                }
            }
            this.ObjectDeclarationOrObjectDataBLOBDeclaration = DeclarationList.ToArray();
            this.ObjectGroupDeclarationsEnd = new bit8StreamObjectHeaderEnd();
            this.ObjectGroupDeclarationsEnd.Parse(s);

            if (ContainsStreamObjectHeader(0x79))
            {
                this.ObjectMetadataDeclaration = new ObjectMetadataDeclaration();
                this.ObjectMetadataDeclaration.Parse(s);
            }

            this.ObjectGroupDataStart = new StreamObjectHeader();
            this.ObjectGroupDataStart = this.ObjectGroupDataStart.TryParse(s);

            List<object> ObjectDataList = new List<object>();
            while (ContainsStreamObjectHeader(0x16) || ContainsStreamObjectHeader(0x1C))
            {
                if (ContainsStreamObjectHeader(0x16))
                {
                    ObjectData data = new ObjectData();
                    data.Parse(s);
                    ObjectDataList.Add(data);
                }
                else if (ContainsStreamObjectHeader(0x1C))
                {
                    ObjectDataBLOBReference DataBLOB = new ObjectDataBLOBReference();
                    DataBLOB.Parse(s);
                    ObjectDataList.Add(DataBLOB);
                }
            }
            this.ObjectDataOrObjectDataBLOBReference = ObjectDataList.ToArray();

            this.ObjectGroupDataEnd = new bit8StreamObjectHeaderEnd();
            this.ObjectGroupDataEnd.Parse(s);
            this.DataElementEnd = new bit8StreamObjectHeaderEnd();
            this.DataElementEnd.Parse(s);
        }
        /// <summary>
        /// Parse the FsshttpbRequest structure.
        /// </summary>
        /// <param name="s">An stream containing FsshttpbRequest structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.ProtocolVersion = ReadUshort();
            this.MinimumVersion = ReadUshort();
            this.Signature = ReadUlong();
            this.RequestStart = new bit32StreamObjectHeaderStart();
            this.RequestStart.Parse(s);
            this.UserAgentStart = new bit32StreamObjectHeaderStart();
            this.UserAgentStart.Parse(s);
            if (ContainsStreamObjectHeader(0x055))
            {
                this.UserAgentGUID = new bit32StreamObjectHeaderStart();
                this.UserAgentGUID.Parse(s);
            }
            if (this.UserAgentGUID != null)
            {
                this.GUID = ReadGuid();
            }
            if (ContainsStreamObjectHeader(0x8B))
            {
                this.UserAgentClientAndPlatform = new bit32StreamObjectHeaderStart();
                this.UserAgentClientAndPlatform.Parse(s);
            }

            if (this.UserAgentClientAndPlatform != null)
            {
                this.ClientCount = new CompactUnsigned64bitInteger();
                this.ClientCount = this.ClientCount.TryParse(s);
                this.ClientByteArray = ReadBytes((int)this.ClientCount.GetUint(this.ClientCount));
                this.PlatformCount = new CompactUnsigned64bitInteger();
                this.PlatformCount = this.PlatformCount.TryParse(s);
                this.PlatformByteArray = ReadBytes((int)this.PlatformCount.GetUint(this.PlatformCount));
            }

            this.UserAgentVersion = new bit32StreamObjectHeaderStart();
            this.UserAgentVersion.Parse(s);
            this.Version = ReadUint();
            this.UserAgentEnd = new bit16StreamObjectHeaderEnd();
            this.UserAgentEnd.Parse(s);
            if (ContainsStreamObjectHeader(0x8D))//TODO: This should be 0x88 accroding to TD, but in the capture files of sharepoint server 2013, it is 0x8D.
            {
                this.RequestHashingOptionsDeclaration = new bit32StreamObjectHeaderStart();
                this.RequestHashingOptionsDeclaration.Parse(s);
            }

            if (this.RequestHashingOptionsDeclaration != null)
            {
                // TODO: Missing fields (A B C D E) here, because it's seems these is not containd in capture files of sharepoint server 13.
                this.RequestHasingSchema = new CompactUnsigned64bitInteger();
                this.RequestHasingSchema = this.RequestHasingSchema.TryParse(s);
            }

            if (ContainsStreamObjectHeader(0x042))
            {
                List<FsshttpbSubRequest> tempRequest = new List<FsshttpbSubRequest>();
                do
                {
                    FsshttpbSubRequest subRequest = new FsshttpbSubRequest();
                    subRequest.Parse(s);
                    tempRequest.Add(subRequest);
                    this.SubRequest = tempRequest.ToArray();
                } while (ContainsStreamObjectHeader(0x042));
            }
            if (ContainsStreamObjectHeader(0x15))
            {
                this.DataElementPackage = new DataElementPackage();
                this.DataElementPackage.Parse(s);
            }
            this.RequestEnd = new bit16StreamObjectHeaderEnd();
            this.RequestEnd.Parse(s);
        }
 /// <summary>
 /// Parse the ObjectMetadata structure.
 /// </summary>
 /// <param name="s">An stream containing ObjectMetadata structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.ObjectGroupMetadata = new bit32StreamObjectHeaderStart();
     this.ObjectGroupMetadata.Parse(s);
     this.ObjectChangeFrequency = new CompactUnsigned64bitInteger();
     this.ObjectChangeFrequency = this.ObjectChangeFrequency.TryParse(s);
 }
        /// <summary>
        /// Parse the FsshttpbSubRequests structure.
        /// </summary>
        /// <param name="s">An stream containing FsshttpbSubRequests structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.SubRequestStart = new bit32StreamObjectHeaderStart();
            this.SubRequestStart.Parse(s);
            this.RequestID = new CompactUnsigned64bitInteger();
            this.RequestID = this.RequestID.TryParse(s);
            this.RequestType = new CompactUnsigned64bitInteger();
            this.RequestType = this.RequestType.TryParse(s);
            this.Priority = new CompactUnsigned64bitInteger();
            this.Priority = this.Priority.TryParse(s);
            if (ContainsStreamObjectHeader(0x83))
            {
                this.TargetPartitionId = new TargetPartitionId();
                this.TargetPartitionId.Parse(s);
            }

            switch (RequestType.GetUint(RequestType))
            {
                case 0x01:
                    this.SubRequestData = new QueryAccessRequest();
                    break;
                case 0x02:
                    this.SubRequestData = new QueryChangesRequest();
                    ((QueryChangesRequest)this.SubRequestData).Parse(s);
                    break;
                case 0x05:
                    this.SubRequestData = new PutChangesRequest();
                    ((PutChangesRequest)this.SubRequestData).Parse(s);
                    break;
                case 0x0B:
                    this.SubRequestData = new AllocateExtendedGUIDRangeRequest();
                    ((AllocateExtendedGUIDRangeRequest)this.SubRequestData).Parse(s);
                    break;
                default:
                    throw new Exception("The RequestType is not right.");
            }
            this.SubRequestEnd = new bit16StreamObjectHeaderEnd();
            this.SubRequestEnd.Parse(s);
        }
        /// <summary>
        /// Parse the RevisionManifestDataElement structure.
        /// </summary>
        /// <param name="s">An stream containing RevisionManifestDataElement structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.DataElementStart = new bit16StreamObjectHeaderStart();
            this.DataElementStart.Parse(s);
            this.DataElementExtendedGUID = new ExtendedGUID();
            this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
            this.SerialNumber = new SerialNumber();
            this.SerialNumber = this.SerialNumber.TryParse(s);
            this.DataElementType = new CompactUnsigned64bitInteger();
            this.DataElementType = this.DataElementType.TryParse(s);
            this.RevisionManifest = new bit16StreamObjectHeaderStart();
            this.RevisionManifest.Parse(s);
            this.RevisionID = new ExtendedGUID();
            this.RevisionID = this.RevisionID.TryParse(s);
            this.BaseRevisionID = new ExtendedGUID();
            this.BaseRevisionID = this.BaseRevisionID.TryParse(s);

            int RevisionType = (CurrentByte() >> 3) & 0x3F;
            List<object> DataList = new List<object>();
            while ((CurrentByte() & 0x03) == 0x0 && (RevisionType == 0x0A || RevisionType == 0x19))
            {
                switch (RevisionType)
                {
                    case 0x0A:
                        {
                            RevisionManifestRootDeclareValues RootDeclareValue = new RevisionManifestRootDeclareValues();
                            RootDeclareValue.Parse(s);
                            DataList.Add(RootDeclareValue);
                            break;
                        }
                    case 0x19:
                        {
                            RevisionManifestObjectGroupReferencesValues ObjectGroupReferencesValue = new RevisionManifestObjectGroupReferencesValues();
                            ObjectGroupReferencesValue.Parse(s);
                            DataList.Add(ObjectGroupReferencesValue);
                            break;
                        }
                    default:
                        throw new Exception("The RevisionType is not right.");
                }
                RevisionType = (CurrentByte() >> 3) & 0x3F;
            }

            this.RevisionManifestDataElementsData = DataList.ToArray();
            this.DataElementEnd = new bit8StreamObjectHeaderEnd();
            this.DataElementEnd.Parse(s);
        }
        /// <summary>
        /// Parse the FsshttpbSubResponse structure.
        /// </summary>
        /// <param name="s">An stream containing FsshttpbSubResponse structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.SubResponseStart = new bit32StreamObjectHeaderStart();
            this.SubResponseStart.Parse(s);
            this.RequestID = new CompactUnsigned64bitInteger();
            this.RequestID = RequestID.TryParse(s);
            this.RequestType = new CompactUnsigned64bitInteger();
            this.RequestType = RequestType.TryParse(s);
            byte tempByte = ReadByte();
            this.Status = GetBits(tempByte, 0, 1);
            this.Reserved = GetBits(tempByte, 1, 7);
            if (this.Status == 0x1)
            {
                this.ResponseError = new ResponseError();
                this.ResponseError.Parse(s);
            }
            else
            {
                if (this.RequestType.GetUint(RequestType) == 0x01)
                {
                    this.SubResponseData = new QueryAccessResponse();
                    ((QueryAccessResponse)this.SubResponseData).Parse(s);
                }
                else if (this.RequestType.GetUint(RequestType) == 0x02)
                {
                    this.SubResponseData = new QueryChangesResponse();
                    ((QueryChangesResponse)this.SubResponseData).Parse(s);
                }
                else if (this.RequestType.GetUint(RequestType) == 0x05)
                {
                    this.SubResponseData = new PutChangesResponse();
                    ((PutChangesResponse)this.SubResponseData).Parse(s);
                }
                else if (this.RequestType.GetUint(RequestType) == 0x0B)
                {
                    this.SubResponseData = new AllocateExtendedGUIDRange();
                    ((AllocateExtendedGUIDRange)this.SubResponseData).Parse(s);
                }

            }
            this.SubResponseEnd = new bit16StreamObjectHeaderEnd();
            this.SubResponseEnd.Parse(s);
        }
 /// <summary>
 /// Parse the StorageManifestDataElement structure.
 /// </summary>
 /// <param name="s">An stream containing StorageManifestDataElement structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.DataElementStart = new bit16StreamObjectHeaderStart();
     this.DataElementStart.Parse(s);
     this.DataElementExtendedGUID = new ExtendedGUID();
     this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
     this.SerialNumber = new SerialNumber();
     this.SerialNumber = this.SerialNumber.TryParse(s);
     this.DataElementType = new CompactUnsigned64bitInteger();
     this.DataElementType = this.DataElementType.TryParse(s);
     this.StorageManifestSchemaGUID = new bit16StreamObjectHeaderStart();
     this.StorageManifestSchemaGUID.Parse(s);
     this.GUID = ReadGuid();
     List<StorageManifestRootDeclareValues> StorageManifestRootDeclareList = new List<StorageManifestRootDeclareValues>();
     while ((CurrentByte() & 0x03) == 0x0 && ((CurrentByte() >> 3) & 0x3F) == 0x07)
     {
         StorageManifestRootDeclareValues tempStorageManifestRootDeclare = new StorageManifestRootDeclareValues();
         tempStorageManifestRootDeclare.Parse(s);
         StorageManifestRootDeclareList.Add(tempStorageManifestRootDeclare);
     }
     this.StorageManifestRootDeclare = StorageManifestRootDeclareList.ToArray();
     this.DataElementEnd = new bit8StreamObjectHeaderEnd();
     this.DataElementEnd.Parse(s);
 }
 /// <summary>
 /// Parse the HierarchyFilter structure.
 /// </summary>
 /// <param name="s">An stream containing HierarchyFilter structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.QueryChangesFilterHierarchy = new bit32StreamObjectHeaderStart();
     this.QueryChangesFilterHierarchy.Parse(s);
     this.Depth = (HierarchyFilterDepth)ReadByte();
     this.Count = new CompactUnsigned64bitInteger();
     this.Count = this.Count.TryParse(s);
     this.RootIndexKeyByteArray = ReadBytes((int)this.Count.GetUint(this.Count));
 }
 /// <summary>
 /// Parse the StringItem structure.
 /// </summary>
 /// <param name="s">An stream containing StringItem structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.Count = new CompactUnsigned64bitInteger();
     this.Count = this.Count.TryParse(s);
     this.Content = ReadString(System.Text.Encoding.Unicode, "", (int)Count.GetUint(Count));
 }
        /// <summary>
        /// Parse the ObjectData structure.
        /// </summary>
        /// <param name="s">An stream containing ObjectData structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.ObjectGroupObjectDataOrExcludedData = new StreamObjectHeader();
            this.ObjectGroupObjectDataOrExcludedData = this.ObjectGroupObjectDataOrExcludedData.TryParse(s);
            this.ObjectExtendedGUIDArray = new ExtendedGUIDArray();
            this.ObjectExtendedGUIDArray.Parse(s);
            this.CellIDArray = new CellIDArray();
            this.CellIDArray.Parse(s);
            this.DataSize = new CompactUnsigned64bitInteger();
            this.DataSize = this.DataSize.TryParse(s);

            if (ContainsStreamObjectHeader(0x20))
            {
                this.Data = new IntermediateNodeObjectData();
                ((IntermediateNodeObjectData)this.Data).Parse(s);

            }
            else if (ContainsStreamObjectHeader(0x1F))
            {
                this.Data = new LeafNodeObjectData();
                ((LeafNodeObjectData)this.Data).Parse(s);
            }
            else
            {
                byte[] dataarray = ReadBytes((int)this.DataSize.GetUint(this.DataSize));
                this.Data = dataarray;
            }
        }
 /// <summary>
 /// Parse the AllocateExtendedGUIDRange structure.
 /// </summary>
 /// <param name="s">An stream containing AllocateExtendedGUIDRange structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.AllocateExtendedGUIDRangeResponse = new bit32StreamObjectHeaderStart();
     this.AllocateExtendedGUIDRangeResponse.Parse(s);
     this.GUIDComponent = ReadGuid();
     this.IntegerRangeMin = new CompactUnsigned64bitInteger();
     this.IntegerRangeMin = this.IntegerRangeMin.TryParse(s);
     this.IntegerRangeMax = new CompactUnsigned64bitInteger();
     this.IntegerRangeMax = this.IntegerRangeMax.TryParse(s);
 }
 /// <summary>
 /// Parse the ObjectDataBLOBDataElements structure.
 /// </summary>
 /// <param name="s">An stream containing ObjectDataBLOBDataElements structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.DataElementStart = new bit16StreamObjectHeaderStart();
     this.DataElementStart.Parse(s);
     this.DataElementExtendedGUID = new ExtendedGUID();
     this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
     this.SerialNumber = new SerialNumber();
     this.SerialNumber = this.SerialNumber.TryParse(s);
     this.DataElementType = new CompactUnsigned64bitInteger();
     this.DataElementType = this.DataElementType.TryParse(s);
     this.ObjectDataBLOB = new StreamObjectHeader();
     this.ObjectDataBLOB = this.ObjectDataBLOB.TryParse(s);
     this.Data = new BinaryItem();
     this.Data.Parse(s);
     this.DataElementEnd = new bit8StreamObjectHeaderEnd();
     this.DataElementEnd.Parse(s);
 }
 /// <summary>
 /// Parse the StringItem structure.
 /// </summary>
 /// <param name="s">An stream containing StringItem structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.Length = new CompactUnsigned64bitInteger();
     this.Length = this.Length.TryParse(s);
     this.Content = ReadBytes((int)Length.GetUint(Length));
 }
 /// <summary>
 /// Parse the ObjectDeclaration structure.
 /// </summary>
 /// <param name="s">An stream containing ObjectDeclaration structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.ObjectGroupObjectDeclaration = new StreamObjectHeader();
     this.ObjectGroupObjectDeclaration = this.ObjectGroupObjectDeclaration.TryParse(s);
     this.ObjectExtendedGUID = new ExtendedGUID();
     this.ObjectExtendedGUID = this.ObjectExtendedGUID.TryParse(s);
     this.ObjectPartitionID = new CompactUnsigned64bitInteger();
     this.ObjectPartitionID = this.ObjectPartitionID.TryParse(s);
     this.ObjectDataSize = new CompactUnsigned64bitInteger();
     this.ObjectDataSize = this.ObjectDataSize.TryParse(s);
     this.ObjectReferencesCount = new CompactUnsigned64bitInteger();
     this.ObjectReferencesCount = this.ObjectReferencesCount.TryParse(s);
     this.CellReferencesCount = new CompactUnsigned64bitInteger();
     this.CellReferencesCount = this.CellReferencesCount.TryParse(s);
 }
 /// <summary>
 /// Parse the CellIDArray structure.
 /// </summary>
 /// <param name="s">An stream containing CellIDArray structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.Count = new CompactUnsigned64bitInteger();
     this.Count = this.Count.TryParse(s);
     List<CellID> tempContent = new List<CellID>();
     if (this.Count.GetUint(Count) > 0)
     {
         ulong tempCount = this.Count.GetUint(Count);
         CellID tempGuid = new CellID();
         do
         {
             tempGuid.Parse(s);
             tempContent.Add(tempGuid);
             tempCount--;
         } while (tempCount > 0);
         this.Content = tempContent.ToArray();
     }
 }
 /// <summary>
 /// Parse the CellKnowledgeRange structure.
 /// </summary>
 /// <param name="s">An stream containing CellKnowledgeRange structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.cellKnowledgeRange = new bit16StreamObjectHeaderStart();
     this.cellKnowledgeRange.Parse(s);
     this.GUID = ReadGuid();
     this.From = new CompactUnsigned64bitInteger();
     this.From = this.From.TryParse(s);
     this.To = new CompactUnsigned64bitInteger();
     this.To = this.To.TryParse(s);
 }