buffer.put( TLV.getBytes( getExtendedRequestLength() ) );
// The requestName, if any
if ( getRequestNameBytes() == null )
{
throw new EncoderException( I18n.err( I18n.ERR_04043 ) );
}
buffer.put( ( byte ) LdapConstants.EXTENDED_REQUEST_NAME_TAG );
buffer.put( TLV.getBytes( getRequestNameBytes().length ) );
if ( getRequestNameBytes().length != 0 )
{
buffer.put( getRequestNameBytes() );
}
// The requestValue, if any
if ( getRequestValue() != null )
{
buffer.put( ( byte ) LdapConstants.EXTENDED_REQUEST_VALUE_TAG );
buffer.put( TLV.getBytes( getRequestValue().length ) );
if ( getRequestValue().length != 0 )
{
buffer.put( getRequestValue() );
}
}
}
catch ( BufferOverflowException boe )
{
throw new EncoderException( I18n.err( I18n.ERR_04005 ) );
}
return buffer;
}