public void encodeData(AsnOutputStream asnOS) throws MAPException { if (this.reason == null) throw new MAPException("Error decoding MAP-RefuseInfo: Reason field must not be empty"); try { asnOS.writeInteger(Tag.CLASS_UNIVERSAL, Tag.ENUMERATED, this.reason.getCode()); if (this.extensionContainer != null) ((MAPExtensionContainerImpl) this.extensionContainer).encodeAll(asnOS); if (this.alternativeAcn != null) asnOS.writeObjectIdentifier(this.alternativeAcn.getOid()); } catch (IOException e) { throw new MAPException("IOException when encoding MAPRefuseInfo: " + e.getMessage(), e); } catch (AsnException e) { throw new MAPException("AsnException when encoding MAPRefuseInfo: " + e.getMessage(), e); } } }
MAPParsingComponentExceptionReason.MistypedParameter); int reasonCode = (int) localAis.readInteger(); this.reason = Reason.getReason(reasonCode);