/// <summary> /// Used to return the length of this element. /// </summary> /// <param name="byteArray">A Byte array</param> /// <param name="startIndex">Start position</param> /// <returns>The element length</returns> public override int DeserializeDataElementDataFromByteArray(byte[] byteArray, int startIndex) { int index = startIndex; this.DataElementFragment = StreamObject.GetCurrent <DataElementFragment>(byteArray, ref index); return(index - startIndex); }
/// <summary> /// Used to return the length of this element. /// </summary> /// <param name="byteArray">A Byte array</param> /// <param name="startIndex">Start position</param> /// <returns>The element length</returns> public override int DeserializeDataElementDataFromByteArray(byte[] byteArray, int startIndex) { int index = startIndex; this.DataElementFragment = StreamObject.GetCurrent<DataElementFragment>(byteArray, ref index); return index - startIndex; }
/// <summary> /// This method is used to test Data Element Fragment related adapter requirements. /// </summary> /// <param name="instance">Specify the instance which need to be verified.</param> /// <param name="site">Specify the ITestSite instance.</param> public void VerifyDataElementFragment(DataElementFragment instance, ITestSite site) { // If the instance is not null and there are no parsing errors, then the DataElementFragment related adapter requirements can be directly captured. if (null == instance) { site.Assert.Fail("The instance of type DataElementFragment is null due to parsing error or type casting error."); } // Verify the stream object header related requirements. this.ExpectStreamObjectHeaderStart(instance.StreamObjectHeaderStart, instance.GetType(), site); // Directly capture requirement MS-FSSHTTPB_R340, if there are no parsing errors. site.CaptureRequirementIfAreEqual<Type>( typeof(StreamObjectHeaderStart32bit), instance.StreamObjectHeaderStart.GetType(), "MS-FSSHTTPB", 340, @"[In Data Element Fragment Data Elements] Data Element Fragment (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies a data element fragment."); // Directly capture requirement MS-FSSHTTPB_R341, if there are no parsing errors. site.CaptureRequirement( "MS-FSSHTTPB", 341, @"[In Data Element Fragment Data Elements] Fragment Extended GUID (variable): An extended GUID that specifies the data element fragment."); // Directly capture requirement MS-FSSHTTPB_R342, if there are no parsing errors. site.CaptureRequirement( "MS-FSSHTTPB", 342, @"[In Data Element Fragment Data Elements] Fragment Data Element Size (variable): A compact unsigned 64-bit integer that specifies the size in bytes of the fragmented data element."); // Directly capture requirement MS-FSSHTTPB_R343, if there are no parsing errors. site.CaptureRequirement( "MS-FSSHTTPB", 343, @"[In Data Element Fragment Data Elements] Fragment File Chunk Reference (variable): A file chunk reference (section 2.2.1.2) that specifies the data element fragment."); // Directly capture requirement MS-FSSHTTPB_R344, if there are no parsing errors. site.CaptureRequirement( "MS-FSSHTTPB", 344, @"[In Data Element Fragment Data Elements] Fragment Data (variable): A byte stream that specifies the binary data opaque to this protocol[MS-FSSHTTPB]."); // Verify the stream object header related requirements. this.ExpectSingleObject(instance.StreamObjectHeaderStart, site); }