Click or drag to resize

FrameImageParserBaseTTypeIdentifier, TOutputTypeParseCommonHeader Method

Parses a common header instance that implements ICommonHeaderTTypeIdentifier for the output type represented in the binary image.

Namespace: GSF.Parsing
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.205-beta+5ef4169f3b1079d8b163dd363614f656bd140924
Syntax
protected abstract ICommonHeader<TTypeIdentifier> ParseCommonHeader(
	byte[] buffer,
	int offset,
	int length
)
View Source

Parameters

buffer  Byte
Buffer containing data to parse.
offset  Int32
Offset index into buffer that represents where to start parsing.
length  Int32
Maximum length of valid data from offset.

Return Value

ICommonHeaderTTypeIdentifier
The ICommonHeaderTTypeIdentifier which includes a type ID for the Type to be parsed.
Remarks

Derived classes need to provide a common header instance (i.e., class that implements ICommonHeaderTTypeIdentifier) for the output types; this will primarily include an ID of the Type that the data image represents. This parsing is only for common header information, actual parsing will be handled by output type via its ParseBinaryImage(Byte, Int32, Int32) method. This header image should also be used to add needed complex state information about the output type being parsed if needed.

If there is not enough buffer available to parse common header (as determined by length), return null. Also, if the protocol allows frame length to be determined at the time common header is being parsed and there is not enough buffer to parse the entire frame, it will be optimal to prevent further parsing by returning null.

See Also