Click or drag to resize

PERAlignedEncoderencodeChoice Method

Encoding of the choice structure ITU-T X.691. 22. NOTE – (Tutorial) A choice type is encoded by encoding an index specifying the chosen alternative. This is encoded as for a constrained integer (unless the extension marker is present in the choice type, in which case it is a normally small non-negative whole number) and would therefore typically occupy a fixed length bit-field of the minimum number of bits needed to encode the index. (Although it could in principle be arbitrarily large.) This is followed by the encoding of the chosen alternative, with alternatives that are extension additions encoded as if they were the value of an open type field. Where the choice has only one alternative, there is no encoding for the index.

Namespace: GSF.ASN1.Coders.PER
Assembly: GSF.ASN1 (in GSF.ASN1.dll) Version: 2.4.181-beta
Syntax
public override int encodeChoice(
	Object obj,
	Stream stream,
	ElementInfo elementInfo
)
View Source

Parameters

obj  Object
 
stream  Stream
 
elementInfo  ElementInfo
 

Return Value

Int32

Implements

IASN1TypesEncoderencodeChoice(Object, Stream, ElementInfo)
See Also