cancelRequestValue ::= SEQUENCE { cancelID MessageID -- MessageID is as defined in [RFC2251] }
818283848586878889909192939495969798
{ de.printStackTrace(); fail( de.getMessage() ); } Cancel cancel = ( ( CancelContainer ) cancelContainer ).getCancel(); assertEquals( 1, cancel.getCancelId() ); // Check the encoding try { ByteBuffer bb = cancel.encode(); String encodedPdu = Strings.dumpBytes(bb.array()); assertEquals( encodedPdu, decodedPdu ); }
8687888990919293949596979899100101102103104105106107108
{ CancelDecoder decoder = new CancelDecoder(); try { Cancel cancel = ( Cancel ) decoder.decode( requestValue ); if ( requestValue != null ) { this.requestValue = new byte[requestValue.length]; System.arraycopy( requestValue, 0, this.requestValue, 0, requestValue.length ); } else { this.requestValue = null; } this.cancelId = cancel.getCancelId(); } catch ( DecoderException e ) { LOG.error( I18n.err( I18n.ERR_04165 ), e ); throw new RuntimeException( e );
124125126127128129130131132133134135136137
{ if ( requestValue == null ) { try { Cancel cancel = new Cancel(); cancel.setCancelId( this.cancelId ); requestValue = cancel.encode().array(); } catch ( EncoderException e ) { LOG.error( I18n.err( I18n.ERR_04164 ), e ); throw new RuntimeException( e );
808182838485868788899091929394959697