Asn1XmlOutputStream Class Reference
Public Member Functions | |
Asn1XmlOutputStream (System.IO.Stream os, bool canonical, int bufSize) | |
Asn1XmlOutputStream (System.IO.Stream os, int bufSize) | |
Asn1XmlOutputStream (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 | EncodeAttr (System.String qname, System.String data) |
virtual void | EncodeBinStrValue (byte[] bits, int nbits) |
virtual void | EncodeByte (byte data) |
virtual void | EncodeData (System.String data) |
virtual void | EncodeDoubleValue (double data, System.String elemName, System.String nsPrefix) |
virtual void | EncodeEmptyElement (System.String elemName, System.String nsPrefix, bool terminate) |
virtual void | EncodeEndDocument () |
virtual void | EncodeEndElement (System.String elemName, System.String nsPrefix, bool indent) |
virtual void | EncodeEndElement (System.String elemName, System.String nsPrefix) |
virtual void | EncodeHexStrValue (byte[] data) |
virtual void | EncodeNamedValue (System.String valueName, System.String elemName, System.String nsPrefix) |
virtual void | EncodeNamedValueElement (System.String valueName) |
virtual void | EncodeObjectId (int[] data) |
virtual void | EncodeStartDocument () |
virtual void | EncodeStartElement (System.String elemName, System.String nsPrefix, bool terminate) |
virtual void | EncodeXSIAttrs () |
virtual void | IncrLevel () |
virtual void | Indent () |
virtual void | SetXSIAttrs (Asn1XmlXSIAttrs data) |
virtual void | Write (System.String data) |
Properties | |
virtual Asn1XmlEncodeHelper | Helper [get] |
virtual int | State [get, set] |
Detailed Description
This class implements the output stream to encode ASN.1 messages as specified in the XML Encoding by the XML schema standard(generated by asn2xsd). 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.
Constructor & Destructor Documentation
Asn1XmlOutputStream | ( | System.IO.Stream | os | ) |
This constructor creates a buffered XML 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.
Asn1XmlOutputStream | ( | System.IO.Stream | os, | |
int | bufSize | |||
) |
This constructor creates a buffered XML output stream object. Whenever the buffer becomes full, the buffer will be flushed to the stream.
- Parameters:
-
os The underlying System.IO.Stream object. bufSize The buffer size. If it is 0 then the output stream is used as unbuffered.
Asn1XmlOutputStream | ( | System.IO.Stream | os, | |
bool | canonical, | |||
int | bufSize | |||
) |
This constructor creates a buffered XML 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.
- Parameters:
-
value The string value to copy
<throws> IOException Any exception thrown by the underlying OutputStream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>
Implements Asn1XmlXerEncoder.
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).
- Parameters:
-
value Array of bytes to copy to the output stream off Starting offset in array len The length to be encoded
<throws> IOException Any exception thrown by the underlying OutputStream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>
Implements Asn1XmlXerEncoder.
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).
- Parameters:
-
value Array of bytes to copy to the output stream
<throws> IOException Any exception thrown by the underlying OutputStream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>
Implements Asn1XmlXerEncoder.
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.
- Parameters:
-
value The byte value to copy
<throws> IOException Any exception thrown by the underlying OutputStream. </throws>
Implements Asn1XmlXerEncoder.
virtual void DecrLevel | ( | ) | [virtual] |
This method decrements the element nesting level counter.
Implements Asn1XmlXerEncoder.
virtual void EncodeAttr | ( | System.String | qname, | |
System.String | data | |||
) | [virtual] |
This method encodes an XML attribute value.
- Parameters:
-
qname Attribute qualified name. value Attribute value in string form.
Implements Asn1XmlEncoder.
virtual void EncodeBinStrValue | ( | byte[] | bits, | |
int | nbits | |||
) | [virtual] |
This method encodes XML binary string data
- Parameters:
-
bits Bit string to encode
<throws> IOException Any exception thrown by the underlying OutputStream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>
Implements Asn1XmlXerEncoder.
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.
- Parameters:
-
value The byte value to copy
<throws> IOException Any exception thrown by the underlying OutputStream. </throws>
Implements Asn1XmlXerEncoder.
virtual void EncodeData | ( | System.String | data | ) | [virtual] |
This method encodes XML string data
- Parameters:
-
value String value to encode
<throws> IOException Any exception thrown by the underlying OutputStream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>
Implements Asn1XmlXerEncoder.
virtual void EncodeDoubleValue | ( | double | data, | |
System.String | elemName, | |||
System.String | nsPrefix | |||
) | [virtual] |
This method encodes an XML REAL (double) value (with start and end tags).
- 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 Asn1XmlEncoder.
virtual void EncodeEmptyElement | ( | System.String | elemName, | |
System.String | nsPrefix, | |||
bool | terminate | |||
) | [virtual] |
This method encodes an XML empty element tag
- Parameters:
-
elemName The name of element. nsPrefix The namespace prefix of element.
<throws> Asn1Exception Thrown, if operation is failed. </throws>
Implements Asn1XmlEncoder.
virtual void EncodeEndDocument | ( | ) | [virtual] |
This method encodes standard trailor information at the end of the XML document.
Implements Asn1XmlXerEncoder.
virtual void EncodeEndElement | ( | System.String | elemName, | |
System.String | nsPrefix, | |||
bool | indent | |||
) | [virtual] |
This method encodes an XML end element tag without indenting
- Parameters:
-
elemName The name of element.
<throws> Asn1Exception Thrown, if operation is failed. </throws>
virtual void EncodeEndElement | ( | System.String | elemName, | |
System.String | nsPrefix | |||
) | [virtual] |
This method encodes an XML end element tag
- Parameters:
-
elemName The name of element, as String.
Implements Asn1XmlEncoder.
virtual void EncodeHexStrValue | ( | byte[] | data | ) | [virtual] |
This method encodes XML hexadecimal string data
- Parameters:
-
data Data to encode
<throws> IOException Any exception thrown by the underlying OutputStream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>
Implements Asn1XmlXerEncoder.
virtual void EncodeNamedValue | ( | System.String | valueName, | |
System.String | elemName, | |||
System.String | nsPrefix | |||
) | [virtual] |
This method encodes an XML named value (with start and end tags)
- Parameters:
-
valueName The name of value. elemName The name of element.
<throws> IOException If I/O error occurs. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>
Implements Asn1XmlEncoder.
virtual void EncodeNamedValueElement | ( | System.String | valueName | ) | [virtual] |
This method encodes an XML named value element tag
- Parameters:
-
valueName The named value, as String.
- Exceptions:
-
Asn1Exception Thrown, if operation is failed.
Implements Asn1XmlXerEncoder.
virtual void EncodeObjectId | ( | int[] | data | ) | [virtual] |
This method encodes XML Object Identifiers and Relative OIDs data
- Parameters:
-
data Object's identificators to encode
<throws> IOException Any exception thrown by the underlying OutputStream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>
Implements Asn1XmlXerEncoder.
virtual void EncodeStartDocument | ( | ) | [virtual] |
This method encodes standard header information at the beginning of the XML document.
Implements Asn1XmlXerEncoder.
virtual void EncodeStartElement | ( | System.String | elemName, | |
System.String | nsPrefix, | |||
bool | terminate | |||
) | [virtual] |
This method encodes an XML start element tag.
- Parameters:
-
elemName The name of element. nsPrefix The namespace prefix of element.
<throws> Asn1Exception Thrown, if operation is failed. </throws>
Implements Asn1XmlEncoder.
virtual void EncodeXSIAttrs | ( | ) | [virtual] |
This method encodes XSI attributes.
Implements Asn1XmlEncoder.
virtual void IncrLevel | ( | ) | [virtual] |
This method increments the element nesting level counter.
Implements Asn1XmlXerEncoder.
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> IOException Any exception thrown by the underlying OutputStream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>
Implements Asn1XmlXerEncoder.
virtual void SetXSIAttrs | ( | Asn1XmlXSIAttrs | data | ) | [virtual] |
This method sets the XSI attributes object to the given value.
- Parameters:
-
value XSI attributes object
Implements Asn1XmlEncoder.
virtual void Write | ( | System.String | data | ) | [virtual] |
This method copies a character string to the output stream.
- Parameters:
-
value The string value to copy
<throws> IOException Any exception thrown by the underlying OutputStream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>
Property Documentation
virtual Asn1XmlEncodeHelper Helper [get] |
virtual int State [get, set] |