Asn1EncodeBuffer Class Reference
Public Member Functions | |
abstract void | BinDump (System.IO.StreamWriter outs, System.String varName) |
virtual void | BinDump (System.String varName) |
abstract void | Copy (byte[] value) |
abstract void | Copy (byte value) |
virtual void | HexDump (System.IO.StreamWriter outs) |
virtual void | HexDump () |
abstract void | Reset () |
abstract void | Write (System.IO.Stream outs) |
Public Attributes | |
const int | SIZE_INCREMENT = 1024 |
Protected Member Functions | |
virtual internal void | CheckSize (int bytesRequired) |
virtual internal void | InitBuffer (int sizeIncrement) |
Protected Attributes | |
internal int | mByteIndex |
internal byte[] | mData |
internal int | mSizeIncrement |
Properties | |
abstract byte[] | MsgCopy [get] |
abstract int | MsgLength [get] |
Detailed Description
This is the base class to specific encode buffer classes for the different types of encoding rules (BER, DER and PER).
Member Function Documentation
abstract void BinDump | ( | System.IO.StreamWriter | outs, | |
System.String | varName | |||
) | [pure virtual] |
This method dumps the encoded message in a human-readable format showing a bit trace of all fields to the given print output stream.
- Parameters:
-
outs Output will be written to this stream varName Name of the Decoded ASN1 Type
Implemented in Asn1BerEncodeBuffer, Asn1PerEncodeBuffer, Asn1XerEncodeBuffer, and Asn1XmlEncodeBuffer.
virtual void BinDump | ( | System.String | varName | ) | [virtual] |
This method invokes an overloaded version of BinDump to dump the encoded message to standard output.
- Parameters:
-
varName Name of the Decoded ASN1 Type
virtual internal void CheckSize | ( | int | bytesRequired | ) | [protected, virtual] |
This method determines if the encode buffer can hold the requested number of bytes. If not, the buffer is expanded.
- Parameters:
-
bytesRequired Number of required bytes.
Reimplemented in Asn1BerEncodeBuffer, Asn1PerEncodeBuffer, Asn1XerEncodeBuffer, and Asn1XmlEncodeBuffer.
abstract void Copy | ( | byte[] | value | ) | [pure virtual] |
This method copies multiple bytes to the encode buffer
- Parameters:
-
value Array of bytes to copy to the encode buffer
Implemented in Asn1BerEncodeBuffer, Asn1PerEncodeBuffer, Asn1XerEncodeBuffer, and Asn1XmlEncodeBuffer.
abstract void Copy | ( | byte | value | ) | [pure virtual] |
This abstract method is used to copy a single byte to the encode buffer.
- Parameters:
-
value The byte value to copy
Implemented in Asn1BerEncodeBuffer, Asn1PerEncodeBuffer, Asn1XerEncodeBuffer, and Asn1XmlEncodeBuffer.
virtual void HexDump | ( | System.IO.StreamWriter | outs | ) | [virtual] |
This method dumps the encoded message in hex/ascii format to the given print output stream.
- Parameters:
-
outs Output stream object reference
virtual void HexDump | ( | ) | [virtual] |
This method dumps the encoded message in hex/ascii format to the standard output stream.
Reimplemented in Asn1PerEncodeBuffer.
virtual internal void InitBuffer | ( | int | sizeIncrement | ) | [protected, virtual] |
This method will intializes this class member variables.
- Parameters:
-
sizeIncrement Buffer size increment in bytes
abstract void Reset | ( | ) | [pure virtual] |
This method resets the buffer to allow a new record to be encoded into it. Any previously encoded data is lost.
Implemented in Asn1BerEncodeBuffer, Asn1PerEncodeBuffer, Asn1XerEncodeBuffer, and Asn1XmlEncodeBuffer.
abstract void Write | ( | System.IO.Stream | outs | ) | [pure virtual] |
This method writes the encoded record to the given output stream.
- Parameters:
-
outs Output stream to which record is to be written
Implemented in Asn1BerEncodeBuffer, Asn1PerEncodeBuffer, Asn1XerEncodeBuffer, and Asn1XmlEncodeBuffer.
Member Data Documentation
internal int mByteIndex [protected] |
This variable holds the position of the byte array for encode buffer.
internal byte [] mData [protected] |
This variable holds the encoded data as byte array.
internal int mSizeIncrement [protected] |
This variable holds the user defined buffer increament size. It defines intial size and size it will be incremented by each time the buffer expands.
const int SIZE_INCREMENT = 1024 |
This constant specifies the default size of the encode buffer and size it will be incremented by each time the buffer expands. It is currently set to 1024 bytes.
Property Documentation
abstract byte [] MsgCopy [get] |
Gets the encoded message in a byte array. This is less efficient than the GetInputStream method because the message contents must be copied to a newly created byte array.
Value:
byte array containing encoded message
Reimplemented in Asn1BerEncodeBuffer, Asn1PerEncodeBuffer, Asn1XerEncodeBuffer, and Asn1XmlEncodeBuffer.
abstract int MsgLength [get] |
Gets the length (in bytes) of the encoded message component.
Value:
length of encoded message component
Reimplemented in Asn1BerEncodeBuffer, Asn1PerEncodeBuffer, Asn1XerEncodeBuffer, and Asn1XmlEncodeBuffer.