protected int extend(final int required){
  final int capacity=Math.max(required,capacity() * 2);
  if (log.isInfoEnabled())   log.info("Extending buffer to capacity=" + capacity + " bytes.");
  return capacity;
}

protected int extend ( final int required ) { final int capacity = Math . max ( required , capacity ( ) * 2 ) ; if ( log . isInfoEnabled ( ) ) log . info ( "Extending buffer to capacity=" + capacity + " bytes." ) ; return capacity ; }
return the new capacity for the buffer ( default is always large enough and will normally double the buffer capacity each time it overflows ) .
