/* Asn1 TYPE NOT YET SUPPORTED
* Encode an Asn1ObjectIdentifier directly to a stream.
* public void encode(Asn1ObjectIdentifier oi, OutputStream out)
* throws IOException
* {
* throw new IOException("LBEREncoder: Encode to a stream not implemented");
* }
*/
/* Asn1 TYPE NOT YET SUPPORTED
* Encode an Asn1CharacterString directly to a stream.
* public void encode(Asn1CharacterString cs, OutputStream out)
* throws IOException
* {
* throw new IOException("LBEREncoder: Encode to a stream not implemented");
* }
*/
/* Encoders for ASN.1 structured types
*/
/// <summary> Encode an Asn1Structured into the specified outputstream. This method
/// can be used to encode SET, SET_OF, SEQUENCE, SEQUENCE_OF
/// </summary>
public void encode(Asn1Structured c, System.IO.Stream out_Renamed)
{
encode(c.getIdentifier(), out_Renamed);
Asn1Object[] value_Renamed = c.toArray();
MemoryStream output = new MemoryStream();
/* Cycle through each element encoding each element */
for (int i = 0; i < value_Renamed.Length; i++)
{
(value_Renamed[i]).encode(this, output);
}
/* Encode the length */
encodeLength((int)output.Length, out_Renamed);
/* Add each encoded element into the output stream */
sbyte[] temp_sbyteArray;
temp_sbyteArray = SupportClass.ToSByteArray(output.ToArray());
out_Renamed.Write(SupportClass.ToByteArray(temp_sbyteArray), 0, temp_sbyteArray.Length);;;
}