// non-javadoc, see interface LineFormatter
        public virtual CharArrayBuffer AppendProtocolVersion(CharArrayBuffer buffer, ProtocolVersion
                                                             version)
        {
            Args.NotNull(version, "Protocol version");
            // can't use initBuffer, that would clear the argument!
            CharArrayBuffer result = buffer;
            int             len    = EstimateProtocolVersionLen(version);

            if (result == null)
            {
                result = new CharArrayBuffer(len);
            }
            else
            {
                result.EnsureCapacity(len);
            }
            result.Append(version.GetProtocol());
            result.Append('/');
            result.Append(Sharpen.Extensions.ToString(version.GetMajor()));
            result.Append('.');
            result.Append(Sharpen.Extensions.ToString(version.GetMinor()));
            return(result);
        }