ASN1C C# Runtime Library  7.2
Public Member Functions | List of all members
Asn1BerMessageDumpHandler Class Reference
Inheritance diagram for Asn1BerMessageDumpHandler:
Asn1TaggedEventHandler

Public Member Functions

 Asn1BerMessageDumpHandler ()
 
 Asn1BerMessageDumpHandler (System.IO.StreamWriter outs)
 
virtual void Contents (byte[] data)
 
virtual void EndElement (Asn1Tag tag)
 
virtual void StartElement (Asn1Tag tag, int len, byte[] tagLenBytes)
 

Detailed Description

This class implements the Asn1EventHandler interface to provide a formatted dump of a BER message to the given print output stream. An object of this type is used in conjunction with the Asn1BerDecodeBuffer Parse method to generically parse a BER message.

Constructor & Destructor Documentation

◆ Asn1BerMessageDumpHandler() [1/2]

The constructor will print the dump result on the standard output stream.

◆ Asn1BerMessageDumpHandler() [2/2]

Asn1BerMessageDumpHandler ( System.IO.StreamWriter  outs)

The constructor sets the StreamWriter object to which the formatted output should be written.

Parameters
outsOutput stream for formatted data

Member Function Documentation

◆ Contents()

virtual void Contents ( byte []  data)
virtual

This method is invoked after each contents field is parsed. It formats and prints the contents in a hex/ascii format.

Parameters
dataArray containing the encoded contents bytes

Implements Asn1TaggedEventHandler.

References Asn1Util.ToHexString().

◆ EndElement()

virtual void EndElement ( Asn1Tag  tag)
virtual

This method is invoked after parsing is complete on each tag/length/value (TLV) in the message.

Parameters
tagArray containing the encoded contents bytes

Implements Asn1TaggedEventHandler.

◆ StartElement()

virtual void StartElement ( Asn1Tag  tag,
int  len,
byte []  tagLenBytes 
)
virtual

This method is invoked after each tag/length value is parsed in the message being dumped. It formats and prints the tag/length values.

Parameters
tagParsed tag value
lenParsed length value
tagLenBytesArray containing the encoded tag/length bytes

Implements Asn1TaggedEventHandler.

References Asn1Tag.Constructed, Asn1Util.ToHexString(), and Asn1Tag.ToString().