/// <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 StreamObjectHeader structure. /// </summary> /// <param name="s">An stream containing StreamObjectHeader structure.</param> public StreamObjectHeader TryParse(Stream s) { base.Parse(s); byte temp = ReadByte(); s.Position -= 1; StreamObjectHeader streamObjectHeader = new StreamObjectHeader(); if ((temp & 0x03) == 0x0) { streamObjectHeader = new bit16StreamObjectHeaderStart(); streamObjectHeader.Parse(s); } else if ((temp & 0x03) == 0x02) { streamObjectHeader = new bit32StreamObjectHeaderStart(); streamObjectHeader.Parse(s); } else if ((temp & 0x03) == 0x01) { streamObjectHeader = new bit8StreamObjectHeaderEnd(); streamObjectHeader.Parse(s); } else if ((temp & 0x03) == 0x03) { streamObjectHeader = new bit16StreamObjectHeaderEnd(); streamObjectHeader.Parse(s); } return streamObjectHeader; }
/// <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 ObjectDataBLOBReference structure. /// </summary> /// <param name="s">An stream containing ObjectDataBLOBReference structure.</param> public override void Parse(Stream s) { base.Parse(s); this.ObjectGroupObjectDataBLOBReference = new StreamObjectHeader(); this.ObjectGroupObjectDataBLOBReference = this.ObjectGroupObjectDataBLOBReference.TryParse(s); this.ObjectExtendedGUIDArray = new ExtendedGUIDArray(); this.ObjectExtendedGUIDArray.Parse(s); this.CellIDArray = new CellIDArray(); this.CellIDArray.Parse(s); this.BLOBExtendedGUID = new ExtendedGUID(); this.BLOBExtendedGUID = this.BLOBExtendedGUID.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 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 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); }