ASN1C C# Runtime Library
7.6
|
Public Member Functions | |
virtual void | AddCaptureBuffer (System.IO.MemoryStream buffer) |
Asn1PerOutputStream (System.IO.Stream os, bool aligned) | |
Asn1PerOutputStream (System.IO.Stream os, int bufSize, bool aligned) | |
virtual void | BinDump (System.String varName) |
virtual void | BinDump (System.IO.StreamWriter outs, System.String varName) |
virtual void | ByteAlign () |
override void | Close () |
virtual void | EncodeBit (bool value) |
virtual void | EncodeBit (bool value, System.String ident) |
virtual void | EncodeBits (byte value, int nbits) |
virtual void | EncodeBits (byte[] value, int offset, int nbits) |
virtual void | EncodeBits (byte[] value, int offset, int nbits, System.String ident) |
virtual void | EncodeCharString (System.String value, int nchars, int offset, int abpc, int ubpc, Asn1CharSet charSet) |
virtual void | EncodeConsWholeNumber (long adjustedValue, long rangeValue, System.String ident) |
virtual void | EncodeConsWholeNumber (long adjustedValue, long rangeValue) |
virtual void | EncodeInt (long value, int nbits, System.String ident) |
virtual void | EncodeInt (long value, int nbits) |
virtual void | EncodeInt (long value, bool encodeLen, bool signExtend, System.String ident) |
virtual void | EncodeInt (long value, bool encodeLen, bool signExtend) |
virtual long | EncodeLength (long value) |
virtual void | EncodeLength (long value, long lower, long upper) |
virtual void | EncodeLengthEOM (long value) |
virtual void | EncodeOctetString (byte[] value, int offset, int nbytes) |
virtual void | EncodeOIDLengthAndValue (int[] value) |
virtual void | EncodeOpenType (byte[] value, int offset, int nbytes) |
virtual void | EncodeRelOIDLengthAndValue (int[] value) |
virtual void | EncodeSmallLength (int value) |
virtual void | EncodeSmallNonNegWholeNumber (int value) |
override void | Flush () |
virtual void | RemoveCaptureBuffer (System.IO.MemoryStream buffer) |
override void | Write (byte[] b) |
override void | Write (System.Byte[] b, int off, int len) |
override void | WriteByte (int b) |
override void | WriteByte (byte b) |
Public Member Functions inherited from Asn1OutputStream | |
Asn1OutputStream (System.IO.Stream os) | |
override void | Close () |
override void | Flush () |
override int | Read (byte[] buffer, int offset, int count) |
override long | Seek (long offset, System.IO.SeekOrigin origin) |
override void | SetLength (long value) |
override void | Write (System.Byte[] b, int off, int len) |
void | Write2Bytes (int value) |
void | Write4Bytes (int value) |
override void | WriteByte (byte b) |
Properties | |
virtual bool | Aligned [get] |
virtual Asn1PerTraceHandler | TraceHandler [get] |
Properties inherited from Asn1OutputStream | |
override bool | CanRead [get] |
override bool | CanSeek [get] |
override bool | CanWrite [get] |
Asn1Context | Context [get] |
override long | Length [get] |
override long | Position [get, set] |
This class handles the output stream for encoding of ASN.1 messages as specified in the Packed Encoding Rules (PER) ITU-T X.691 standard.
Asn1PerOutputStream | ( | System.IO.Stream | os, |
bool | aligned | ||
) |
This constructor creates a buffered PER output stream object with the default size of buffer. Whenever the buffer becomes full, the buffer will be flushed to the stream.
os | The underlying System.IO.Stream object. |
aligned | Indicates whether PER aligned or unaligned encoding should be done. |
Asn1PerOutputStream | ( | System.IO.Stream | os, |
int | bufSize, | ||
bool | aligned | ||
) |
This constructor creates a buffered PER output stream object with the specified size of buffer. Whenever the buffer becomes full, the buffer will be flushed to the stream.
os | The underlying System.IO.Stream object. |
bufSize | The buffer size. |
aligned | true for PER aligned or false for PER unaligned encoding. |
|
virtual |
This method is used to add a capture buffer to the internal capture buffer list. A capture buffer is used to capture all bytes read from this position forward from the input stream.
buffer | Buffer into which captured bytes are to be stored |
Referenced by Asn1PerOutputStreamTraceHandler.Enable().
|
virtual |
This method invokes an overloaded version of BinDump to dump the encoded message to standard output.
varName | Name of top-level message object variable |
|
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.
outs | StreamWriter object to which output should be written |
varName | Name of top-level message object variable |
References Asn1PerOutputStreamTraceHandler.Print().
|
virtual |
This methods byte-aligns the buffer.
References Asn1PerEncodeBuffer.ByteAlign().
override void Close | ( | ) |
Close the stream. Writes all bytes (even unfinished) before closing. Throws, exception thrown by the underlying System.IO.Stream object.
References Asn1PerEncodeBuffer.EncodeBits(), Asn1PerMessageBuffer.MsgBitCnt, and Asn1PerEncodeBuffer.Reset().
|
virtual |
This method encodes a single bit value.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Boolean value of bit to be encoded. |
Asn1Exception | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeBit().
|
virtual |
This method encodes a single bit value.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Boolean value of bit to be encoded. |
ident | Bit field identifier name for tracing. |
Asn1Exception | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeBit().
|
virtual |
This method encodes bit values from an octet. The most significant bits from the octet are encoded.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Octet containing bits to be encoded |
nbits | Number of bits to encode |
Asn1InvalidArgException | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeBits().
|
virtual |
This method encodes bit values from an array of octets.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Octet array containing bits to be encoded |
offset | Starting byte offset in value |
nbits | Number of bits to encode |
Asn1InvalidArgException | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeBits().
|
virtual |
This method encodes bit values from an array of octets.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Octet array containing bits to be encoded |
offset | Starting byte offset in value |
nbits | Number of bits to encode |
ident | Bit field identifier name for tracing. |
Asn1InvalidArgException | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeBits().
|
virtual |
This method encodes the contents of a known-multiplier character string type. This version assumes a permitted alphabet constraint was specified.
Throws, exception thrown by the underlying System.IO.Stream object.
value | String containing characters to encode |
nchars | Number of characters from string to encode |
offset | Offset to first char in string to encode |
abpc | Number of bits per character (aligned) |
ubpc | Number of bits per character (unaligned) |
charSet | Object representing permitted alphabet constraint character set (optional) |
Asn1Exception | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeCharString().
|
virtual |
This method implements the rules to encode a constrained whole number as specified in section 10.5 of the X.691 standard.
Throws, exception thrown by the underlying System.IO.Stream object.
adjustedValue | Adjusted value to be encoded = value - lower range endpoint value |
rangeValue | lower - upper + 1 |
ident | Bit field identifier name for tracing. |
Asn1InvalidArgException | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeConsWholeNumber().
|
virtual |
This method implements the rules to encode a constrained whole number as specified in section 10.5 of the X.691 standard.
Throws, exception thrown by the underlying System.IO.Stream object.
adjustedValue | Adjusted value to be encoded = value - lower range endpoint value |
rangeValue | lower - upper + 1 |
Asn1InvalidArgException | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeConsWholeNumber().
|
virtual |
This method encodes bit values from an integer value. The least significant bits from the integer are encoded.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Integer containing bits to be encoded |
nbits | Number of bits to encode |
ident | Bit field identifier name for tracing. |
Asn1InvalidArgException | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeInt().
|
virtual |
This method encodes bit values from an integer value. The least significant bits from the integer are encoded.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Integer containing bits to be encoded |
nbits | Number of bits to encode |
Asn1InvalidArgException | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeInt().
|
virtual |
This method implements the rules to encode either a non-negative binary integer as specified in section 10.3 or a two's complement binary integer as specified in section 10.4 of the X.691 standard.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Integer value to be encoded |
encodeLen | Flag indicating length determinant should be encoded before encoding integer value. |
signExtend | Flag indicating if sign extension should be performed. |
ident | Bit field identifier name for tracing. |
Asn1InvalidArgException | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeInt().
|
virtual |
This method implements the rules to encode either a non-negative binary integer as specified in section 10.3 or a two's complement binary integer as specified in section 10.4 of the X.691 standard.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Integer value to be encoded |
encodeLen | Flag indicating length determinant should be encoded before encoding integer value. |
signExtend | Flag indicating if sign extension should be performed. |
Asn1InvalidArgException | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeInt().
|
virtual |
This method encodes a general (unconstrained) length determinant value as described in section 10.9 or the X.691 standard.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Length value to be encoded |
Asn1InvalidArgException | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeLength().
|
virtual |
This method encodes a constrained length determinant value.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Length value to be encoded |
lower | Lower bound (inclusive) of length value range |
upper | Upper bound (inclusive) of length value range |
Asn1Exception | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeLength().
|
virtual |
This method checks to see if a zero byte needs to be added after a fragmented length has been encoded. It will add it to the byte stream if necessary.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Original length value that was encoded. |
Asn1Exception | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeLengthEOM().
|
virtual |
This method encodes the given array of bytes as an unconstrained octet string value.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Byte array containing data to encode. This is assumed to contain a previously encoded PER component. |
offset | Starting offset in byte array value |
nbytes | Number of bytes to encode |
Asn1Exception | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeOctetString().
|
virtual |
This method encodes the length and contents of an object identifier value.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Integer array containing arcs to encode |
Asn1Exception | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeOIDLengthAndValue().
Referenced by Asn1ObjectIdentifier.ToString().
|
virtual |
This method encodes the given array of bytes as an open type.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Byte array containing data to encode. This is assumed to contain a previously encoded PER component. |
offset | Starting offset in byte array value |
nbytes | Number of bytes to encode |
Asn1Exception | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeOpenType().
Referenced by Asn1ChoiceExt.Encode(), and Asn1OpenType.ToString().
|
virtual |
This method encodes the length and contents of a relative object identifier value.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Integer array containing arcs to encode |
Asn1Exception | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeRelOIDLengthAndValue().
Referenced by Asn1RelativeOID.DecodeXML().
|
virtual |
This method implements the rules to encode a normally small length as specified in section 11.9 of the X.691 standard.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Value to be encoded |
Asn1InvalidArgException | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeSmallLength().
|
virtual |
This method implements the rules to encode a small non-negative whole number as specified in section 10.6 of the X.691 standard.
Throws, exception thrown by the underlying System.IO.Stream object.
value | Value to be encoded |
Asn1InvalidArgException | Any exception thrown by the underlying Asn1PerEncodeBuffer. |
References Asn1PerEncodeBuffer.EncodeSmallNonNegWholeNumber().
override void Flush | ( | ) |
Flush the buffer to the stream. It writes whole bytes only. Throws, exception thrown by the underlying System.IO.Stream object.
|
virtual |
This method is used to remove a capture buffer from the internal capture buffer list. The add and remove methods can be used to get a set of raw bytes from the input stream for further processing.
buffer | Buffer in which captured bytes stored |
|
virtual |
Writes b.length
bytes from the specified byte array to this output stream. The general contract for write(b)
is that it should have exactly the same effect as the call Write(b, 0, b.length)
.
b | the binary data. |
System.SystemException | if an I/O error occurs. |
Reimplemented from Asn1OutputStream.
override void Write | ( | System.Byte [] | b, |
int | off, | ||
int | len | ||
) |
Writes len
bytes from the specified byte array to this output stream.
b | the data. |
off | The offset in array at which to begin write. |
len | The number of bytes to write. |
System.SystemException | if an I/O error occurs. In particular, write call after the the output stream is closed. |
|
virtual |
Writes the specified byte to this output stream.
b | the byte. |
System.SystemException | if an I/O error occurs. In particular, an write call after the output stream has been closed. |
Reimplemented from Asn1OutputStream.
override void WriteByte | ( | byte | b | ) |
Writes the specified byte to this output stream.
b | the byte. |
System.SystemException | if an I/O error occurs. In particular, an write call after the output stream has been closed. |
|
get |
Gets PER aligned encoding has been specified.
Value:
true
is aligned; otherwise false
|
get |
Gets a reference to the internal trace handler object used to trace the bit fields within a PER message.
Value:
Asn1PerTraceHandler object