Esempio n. 1
0
 public void Write(BerTag tag, bool value)
 {
     WriteOuterHeader(tag, 3);
     BerEncoding.EncodeTag(_output, new BerTag(BerType.Boolean));
     BerEncoding.EncodeLength(_output, 1);
     BerEncoding.EncodeBoolean(_output, value);
 }
Esempio n. 2
0
        /// <summary>
        /// Pre-encodes the BER header and returns the byte length of the encoded node.
        /// Overriden to encode the entire TLTLV
        /// </summary>
        /// <returns>The length of the encoded node.</returns>
        internal override int Update()
        {
            var output = new BerMemoryOutput();

            BerEncoding.EncodeTag(output, Tag.ToContainer());
            BerEncoding.EncodeLength(output, 3);

            BerEncoding.EncodeTag(output, new BerTag(BerType.Boolean));
            BerEncoding.EncodeLength(output, 1);
            BerEncoding.EncodeBoolean(output, Value);

            Encoded       = output.ToArray();
            EncodedLength = Encoded.Length;

            return(EncodedLength);
        }