public void encode(AsnOutputStream aos) throws EncodeException {

        try {
            if (this.isInteger()) {
                aos.writeInteger(Tag.CLASS_PRIVATE, ApplicationContext._TAG_INTEGER, integerVal);
            } else if (this.isObjectID()) {
                aos.writeObjectIdentifier(Tag.CLASS_PRIVATE, ApplicationContext._TAG_OBJECT_ID, this.oidVal);
            } else {
                throw new EncodeException("Error while encoding ApplicationContextName: Neither OId nor Integer value is set");
            }

        } catch (IOException e) {
            throw new EncodeException("IOException while encoding ApplicationContextName: " + e.getMessage(), e);
        } catch (AsnException e) {
            throw new EncodeException("AsnException while encoding ApplicationContextName: " + e.getMessage(), e);
        }
    }
public void encode ( AsnOutputStream aos ) throws EncodeException { try { if ( this . isInteger ( ) ) { aos . writeInteger ( Tag . CLASS_PRIVATE , ApplicationContext . _TAG_INTEGER , integerVal ) ; } else if ( this . isObjectID ( ) ) { aos . writeObjectIdentifier ( Tag . CLASS_PRIVATE , ApplicationContext . _TAG_OBJECT_ID , this . oidVal ) ; } else { throw new EncodeException ( "Error while encoding ApplicationContextName: Neither OId nor Integer value is set" ) ; } } catch ( IOException e ) { throw new EncodeException ( "IOException while encoding ApplicationContextName: " + e . getMessage ( ) , e ) ; } catch ( AsnException e ) { throw new EncodeException ( "AsnException while encoding ApplicationContextName: " + e . getMessage ( ) , e ) ; } }
/*
(non-Javadoc)

@see org.restcomm.protocols.ss7.tcap.asn.Encodable#encode(org.mobicents.protocols .asn.AsnOutputStream)