{
int length = content.remaining();
int requiredCapacity = size + length;
if (requiredCapacity > buffer.length) {
if (requiredCapacity > maxLength) {
response.abort(new ResponseTooLargeException());
return;
}
// newCapacity = min(log2ceiling(requiredCapacity), maxLength);
int newCapacity = min(Integer.highestOneBit(requiredCapacity) << 1, maxLength);