Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Open Source
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

Asn1XerOutputStream Class Reference

Inheritance diagram for Asn1XerOutputStream:

Asn1OutputStream Asn1XerEncoder Asn1XmlOutputStream List of all members.

Detailed Description

This class implements the output stream to encode ASN.1 messages as specified in the XML Encoding Rules (XER) as specified in the ITU-T X.693 standard. A reference to an object of this type is passed to each of the ASN.1 type encode methods involved in encoding a particular message type.


Public Member Functions

 Asn1XerOutputStream (System.IO.Stream os, bool canonical, int bufSize)
 Asn1XerOutputStream (System.IO.Stream os)
virtual void Copy (System.String data)
virtual void Copy (byte[] data, int off, int len)
virtual void Copy (byte[] data)
virtual void Copy (byte data)
virtual void DecrLevel ()
virtual void EncodeBinStrValue (byte[] bits, int nbits)
virtual void EncodeByte (byte data)
virtual void EncodeData (System.String data)
virtual void EncodeEmptyElement (System.String elemName, System.String attribute)
virtual void EncodeEmptyElement (System.String elemName)
virtual void EncodeEndDocument ()
virtual void EncodeEndElement (System.String elemName)
virtual void EncodeHexStrValue (byte[] data)
virtual void EncodeNamedValue (System.String valueName, System.String elemName, System.String attribute)
virtual void EncodeNamedValue (System.String valueName, System.String elemName)
virtual void EncodeNamedValueElement (System.String elemName)
virtual void EncodeObjectId (int[] data)
virtual void EncodeRealValue (double data, System.String elemName, System.String attribute)
virtual void EncodeRealValue (double data, System.String elemName)
virtual void EncodeStartDocument ()
virtual void EncodeStartElement (System.String elemName, System.String attribute)
virtual void EncodeStartElement (System.String elemName)
virtual void IncrLevel ()
virtual void Indent ()
virtual void Write (System.String data)

Properties

virtual bool Canonical
virtual int State


Constructor & Destructor Documentation

Asn1XerOutputStream System.IO.Stream  os  ) 
 

This constructor creates a buffered XER output stream object with default size of buffer. Whenever the buffer becomes full, the buffer will be flushed to the stream.

Parameters:
os The underlying System.IO.Stream object.

Asn1XerOutputStream System.IO.Stream  os,
bool  canonical,
int  bufSize
 

This constructor creates a buffered XER output stream object. Whenever the buffer becomes full, the buffer will be flushed to the stream.

Parameters:
os The underlying System.IO.Stream object.
canonical Boolean indicating a canonical or non-canonical encoding should be produced as defined in the X.693 standard.
bufSize The buffer size. If it is 0 then the output stream is used as unbuffered.


Member Function Documentation

virtual void Copy System.String  data  )  [virtual]
 

This method copies a character string to the output stream.

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
data The string value to copy
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void Copy byte[]  data,
int  off,
int  len
[virtual]
 

This method copies multiple bytes to the output stream. It is assumed the byte are already formatted into a valid XML encoding type (for example, UTF-8).

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
data Array of bytes to copy to the output stream
off The offset in array at which to begin copy.
len The Number of bytes to copy
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void Copy byte[]  data  )  [virtual]
 

This method copies multiple bytes to the output stream. It is assumed the byte are already formatted into a valid XML encoding type (for example, UTF-8).

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
data Array of bytes to copy to the output stream
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void Copy byte  data  )  [virtual]
 

This method is used to copy a single byte to the output stream. It first converts the byte to a hex character representation and then copies it to the output buffer.

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
data The byte value to copy

Implements Asn1XerEncoder.

virtual void DecrLevel  )  [virtual]
 

This method decrements the element nesting level counter.

Implements Asn1XerEncoder.

virtual void EncodeBinStrValue byte[]  bits,
int  nbits
[virtual]
 

This method encodes XML binary string data

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
bits Bit String to encode
nbits Number of bits to encode
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void EncodeByte byte  data  )  [virtual]
 

This method is used to encode a single byte to the output stream. It first converts the byte to a hex character representation and then copies it to the output buffer.

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
data The byte value to copy

Implements Asn1XerEncoder.

virtual void EncodeData System.String  data  )  [virtual]
 

This method encodes XML string data

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
data String value to encode
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void EncodeEmptyElement System.String  elemName,
System.String  attribute
[virtual]
 

This method encodes an XML empty element tag

Parameters:
elemName The name of element.
attribute The name and value of attribute.

Implements Asn1XerEncoder.

virtual void EncodeEmptyElement System.String  elemName  )  [virtual]
 

This method encodes an XML empty element tag.

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
elemName The name of element.
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void EncodeEndDocument  )  [virtual]
 

This method encodes standard trailor information at the end of the XML document.

Throws, exception thrown by the underlying System.IO.Stream.

Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void EncodeEndElement System.String  elemName  )  [virtual]
 

This method encodes an XML end element tag.

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
elemName The name of element.
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

Reimplemented in Asn1XmlOutputStream.

virtual void EncodeHexStrValue byte[]  data  )  [virtual]
 

This method encodes XML hexadecimal string data

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
data Data to encode
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void EncodeNamedValue System.String  valueName,
System.String  elemName,
System.String  attribute
[virtual]
 

This method encodes an XML named value (with start and end tags)

Parameters:
valueName The named value.
elemName The name of element.
attribute The name and value of attribute.

Implements Asn1XerEncoder.

virtual void EncodeNamedValue System.String  valueName,
System.String  elemName
[virtual]
 

This method encodes an XML named value (with start and end tags).

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
valueName The named value.
elemName The name of element.
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void EncodeNamedValueElement System.String  elemName  )  [virtual]
 

This method encodes an XML named value element tag.

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
elemName The name of element.
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

Reimplemented in Asn1XmlOutputStream.

virtual void EncodeObjectId int[]  data  )  [virtual]
 

This method encodes XML Object Identifiers and Relative OIDs data

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
data Object's identificators to encode
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void EncodeRealValue double  data,
System.String  elemName,
System.String  attribute
[virtual]
 

This method encodes an XML REAL (double) value (with start and end tags).

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
data The value to be encoded.
elemName The name of element. If null, then start and end tags won't be encoded.
attribute The name and value of attribute.
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void EncodeRealValue double  data,
System.String  elemName
[virtual]
 

This method encodes an XML REAL (double) value (with start and end tags).

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
data The value to be encoded.
elemName The name of element. If null, then start and end tags won't be encoded.
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void EncodeStartDocument  )  [virtual]
 

This method encodes standard header information at the beginning of the XML document.

Throws, exception thrown by the underlying System.IO.Stream.

Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void EncodeStartElement System.String  elemName,
System.String  attribute
[virtual]
 

This method encodes an XML start element tag with attribute.

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
elemName The name of element.
attribute The name of attribute.
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void EncodeStartElement System.String  elemName  )  [virtual]
 

This method encodes an XML start element tag.

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
elemName The name of element.
Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void IncrLevel  )  [virtual]
 

This method increments the element nesting level counter.

Implements Asn1XerEncoder.

virtual void Indent  )  [virtual]
 

This methods indents by adding a new-line followed by whitespace corresponding to the current nesting level to the output stream.

Throws, exception thrown by the underlying System.IO.Stream.

Exceptions:
Asn1Exception Thrown, if operation is failed.

Implements Asn1XerEncoder.

virtual void Write System.String  data  )  [virtual]
 

This method copies a character string to the output stream.

Throws, exception thrown by the underlying System.IO.Stream.

Parameters:
data The string value to copy
Exceptions:
Asn1Exception Thrown, if operation is failed.


Property Documentation

virtual bool Canonical [set]
 

Sets the canonical encoding rule.

Value: true if canonical encoding; otherwise false.

virtual int State [set]
 

Sets the state of the buffer.

Value: buffer stat

Implements Asn1XerEncoder.


Copyright © 1997-2005 Objective Systems,Inc.
All Rights Reserved.
This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.

This file was last modified on 18 Nov 2005.
ASN1C C# Runtime Library, 5.8