private static int FormatWWWAuthenticate(byte[] buffer, int offset, IHeaderField field) { WWWAuthenticateHf authHf = (WWWAuthenticateHf)field; string result = string.Format("Basic realm=\"{0}\", charset=\"{1}\"", authHf.Realm, authHf.Charset); return(Encoding.ASCII.GetBytes(result, 0, result.Length, buffer, offset)); }
private static int FormattedWWWAuthenticateLength(IHeaderField field) { WWWAuthenticateHf authHf = (WWWAuthenticateHf)field; int len = authHf.Realm.Length + authHf.Charset.Length + 26; return(len); }