예제 #1
0
    public override byte[] Compose()
    {
        var name = base.Compose();

        var bl = new BinaryList()
                 .AddUInt8((byte)name.Length)
                 .AddUInt8Array(name)
                 .AddUInt8Array(ReturnType.Compose())
                 .AddUInt8((byte)Arguments.Length);

        for (var i = 0; i < Arguments.Length; i++)
        {
            bl.AddUInt8Array(Arguments[i].Compose());
        }


        if (Annotation != null)
        {
            var exp = DC.ToBytes(Annotation);
            bl.AddInt32(exp.Length)
            .AddUInt8Array(exp);
            bl.InsertUInt8(0, Inherited ? (byte)0x90 : (byte)0x10);
        }
        else
        {
            bl.InsertUInt8(0, Inherited ? (byte)0x80 : (byte)0x0);
        }

        return(bl.ToArray());
    }