Updates:
        Status: Fixed

Comment #1 on issue 132 by [email protected]: TCAP: ParameterImpl: support for extra parameter length field
http://code.google.com/p/jss7/issues/detail?id=132

Hello!

I have to use some tricky way to implement this functionality unfortunately.
Added in Parameter:
        /**
         * Return the length value that was encoded in ASN.1 stream
* Usually this value ==getData().length and we can use "getData().length" as the length value * Checking this field makes sense when special cases when "encoded length value"!=getData().length
         *
         * @return
         */
        public int getEncodingLength();

        /**
         * Set a length that will be encoded when ASN.1 parameter encoding
         * Usually this length is equal getData().length and we need not set 
this
         * You can use this only when "encoded length value"!=getData().length
* If setEncodingLength() has not been invoked the value for length encoding will be ==getData().length
         *
         * @param val
         */
        public void setEncodingLength(int val);
        public void setSingleParameterInAsn();

In TcapFactory:
public static Parameter createParameter(int tag, AsnInputStream localAis) throws ParseException
replaced with:
public static Parameter createParameter(int tag, AsnInputStream localAis, boolean singleParameterInAsn) throws ParseException

"singleParameterInAsn" means:
- if true and after decoding of a parameter there is some data in AsnInputStream this data is added into an "data" field of Parameter
- if false - is not added

true is used for InvokeImpl, ReturnErrorImpl, ReturnResultImpl, ReturnResultLastImpl
false is used in ParameterImpl.getParameters()

http://code.google.com/p/jss7/source/detail?r=f49b76fd1e1fe0566fee2e67fc4522b7f19ae7a5
http://code.google.com/p/jss7/source/detail?r=f8d6b0f42dad8d088b4d0b95aa5f688f1ab774c0


Reply via email to