public RfcControl(Asn1Structured seqObj) : base(3) { for (var i = 0; i < seqObj.Size(); i++) { Add(seqObj.Get(i)); } }
/// <summary> /// Encode an Asn1Structured into the specified outputstream. This method /// can be used to encode SET, SET_OF, SEQUENCE, SEQUENCE_OF /// </summary> /// <param name="c">The Asn1Structured object to encode</param> /// <param name="stream">The stream.</param> public void Encode(Asn1Structured c, Stream stream) { Encode(c.GetIdentifier(), stream); var arrayValue = c.ToArray(); var output = new MemoryStream(); foreach (var obj in arrayValue) { obj.Encode(this, output); } EncodeLength((int)output.Length, stream); var tempSbyteArray = output.ToArray().ToSByteArray(); stream.Write(tempSbyteArray.ToByteArray(), 0, tempSbyteArray.Length); }
/// <summary> /// Encode an Asn1Structured into the specified outputstream. This method /// can be used to encode SET, SET_OF, SEQUENCE, SEQUENCE_OF. /// </summary> /// <param name="c">The Asn1Structured object to encode.</param> /// <param name="stream">The stream.</param> public static void Encode(Asn1Structured c, Stream stream) { Encode(c.GetIdentifier(), stream); var arrayValue = c.ToArray(); using (var output = new MemoryStream()) { foreach (var obj in arrayValue) { Encode(obj, output); } EncodeLength((int)output.Length, stream); var tempSbyteArray = output.ToArray(); stream.Write(tempSbyteArray, 0, tempSbyteArray.Length); } }