com.objsys.asn1j.runtime
Class Asn1BerMessageDumpHandler

java.lang.Object
  extended by com.objsys.asn1j.runtime.Asn1BerMessageDumpHandler
All Implemented Interfaces:
Asn1TaggedEventHandler

public class Asn1BerMessageDumpHandler
extends java.lang.Object
implements Asn1TaggedEventHandler

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 Summary
Asn1BerMessageDumpHandler(java.io.PrintStream out)
          The constructor sets the PrintStream object to which the formatted output should be written.
 
Method Summary
 void contents(byte[] data)
          This method is invoked after each contents field is parsed.
 void endElement(Asn1Tag tag)
          This method is invoked after parsing is complete on each tag/length/value (TLV) in the message.
 void startElement(Asn1Tag tag, int len, byte[] tagLenBytes)
          This method is invoked after each tag/length value is parsed in the message being dumped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Asn1BerMessageDumpHandler

public Asn1BerMessageDumpHandler(java.io.PrintStream out)
The constructor sets the PrintStream object to which the formatted output should be written.

Parameters:
out - Output stream for formatted data
Method Detail

startElement

public void startElement(Asn1Tag tag,
                         int len,
                         byte[] tagLenBytes)
This method is invoked after each tag/length value is parsed in the message being dumped. It formats and prints the tag/length values.

Specified by:
startElement in interface Asn1TaggedEventHandler
Parameters:
tag - Parsed tag value
len - Parsed length value
tagLenBytes - Array containing the encoded tag/length bytes

contents

public void contents(byte[] data)
This method is invoked after each contents field is parsed. It formats and prints the contents in a hex/ascii format.

Specified by:
contents in interface Asn1TaggedEventHandler
Parameters:
data - Array containing the encoded contents bytes

endElement

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

Specified by:
endElement in interface Asn1TaggedEventHandler
Parameters:
tag - Array containing the encoded contents bytes