if ( isRefreshDeletes() ) BerValue.encode( buffer, isRefreshDeletes() );
if ( isRefreshDeletes() ) BerValue.encode( buffer, isRefreshDeletes() );
if ( isRefreshDeletes() ) BerValue.encode( buffer, isRefreshDeletes() );
/** * Encode the SyncDoneValue control * * @param buffer The encoded sink * @return A ByteBuffer that contains the encoded PDU * @throws EncoderException If anything goes wrong while encoding. */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_08000_CANNOT_PUT_A_PDU_IN_NULL_BUFFER ) ); } // Encode the SEQ buffer.put( UniversalTag.SEQUENCE.getValue() ); buffer.put( TLV.getBytes( syncDoneValueLength ) ); if ( getCookie() != null ) { BerValue.encode( buffer, getCookie() ); } if ( isRefreshDeletes() ) { BerValue.encode( buffer, isRefreshDeletes() ); } return buffer; }
/** * Encode the SyncDoneValue control * * @param buffer The encoded sink * @return A ByteBuffer that contains the encoded PDU * @throws EncoderException If anything goes wrong while encoding. */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_08000_CANNOT_PUT_A_PDU_IN_NULL_BUFFER ) ); } // Encode the SEQ buffer.put( UniversalTag.SEQUENCE.getValue() ); buffer.put( TLV.getBytes( syncDoneValueLength ) ); if ( getCookie() != null ) { BerValue.encode( buffer, getCookie() ); } if ( isRefreshDeletes() ) { BerValue.encode( buffer, isRefreshDeletes() ); } return buffer; }
/** * Encode the SyncDoneValue control * * @param buffer The encoded sink * @return A ByteBuffer that contains the encoded PDU * @throws EncoderException If anything goes wrong while encoding. */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_08000_CANNOT_PUT_A_PDU_IN_NULL_BUFFER ) ); } // Encode the SEQ buffer.put( UniversalTag.SEQUENCE.getValue() ); buffer.put( TLV.getBytes( syncDoneValueLength ) ); if ( getCookie() != null ) { BerValue.encode( buffer, getCookie() ); } if ( isRefreshDeletes() ) { BerValue.encode( buffer, isRefreshDeletes() ); } return buffer; }
/** * Compute the syncDoneValue length. * <pre> * 0x30 L1 * | * +--> 0x04 L2 xkcd!!!... (cookie) * +--> 0x01 0x01 [0x00|0xFF] (refreshDeletes) * </pre> * * @return The computed length */ @Override public int computeLength() { // cookie's length if ( getCookie() != null ) { syncDoneValueLength = 1 + TLV.getNbBytes( getCookie().length ) + getCookie().length; } // the refreshDeletes flag length if ( isRefreshDeletes() ) { syncDoneValueLength += 1 + 1 + 1; } valueLength = 1 + TLV.getNbBytes( syncDoneValueLength ) + syncDoneValueLength; // Call the super class to compute the global control length return valueLength; }
/** * Compute the syncDoneValue length. * <pre> * 0x30 L1 * | * +--> 0x04 L2 xkcd!!!... (cookie) * +--> 0x01 0x01 [0x00|0xFF] (refreshDeletes) * </pre> * * @return The computed length */ @Override public int computeLength() { // cookie's length if ( getCookie() != null ) { syncDoneValueLength = 1 + TLV.getNbBytes( getCookie().length ) + getCookie().length; } // the refreshDeletes flag length if ( isRefreshDeletes() ) { syncDoneValueLength += 1 + 1 + 1; } valueLength = 1 + TLV.getNbBytes( syncDoneValueLength ) + syncDoneValueLength; // Call the super class to compute the global control length return valueLength; }
/** * Compute the syncDoneValue length. * <pre> * 0x30 L1 * | * +--> 0x04 L2 xkcd!!!... (cookie) * +--> 0x01 0x01 [0x00|0xFF] (refreshDeletes) * </pre> * * @return The computed length */ @Override public int computeLength() { // cookie's length if ( getCookie() != null ) { syncDoneValueLength = 1 + TLV.getNbBytes( getCookie().length ) + getCookie().length; } // the refreshDeletes flag length if ( isRefreshDeletes() ) { syncDoneValueLength += 1 + 1 + 1; } valueLength = 1 + TLV.getNbBytes( syncDoneValueLength ) + syncDoneValueLength; // Call the super class to compute the global control length return valueLength; }