throw new IllegalArgumentException
("Protocol version may not be null");
}
// can't use initBuffer, that would clear the argument!
CharArrayBuffer result = buffer;
final int len = estimateProtocolVersionLen(version);
if (result == null) {
result = new CharArrayBuffer(len);
} else {
result.ensureCapacity(len);
}
result.append(version.getProtocol());
result.append('/');
result.append(Integer.toString(version.getMajor()));
result.append('.');
result.append(Integer.toString(version.getMinor()));
return result;
}