Exemplo n.º 1
0
        internal HttpTrailerField(byte[] fieldValue)
            : base("Trailer", (IList <byte>)fieldValue)
        {
            string @string = HttpRegex.GetString(fieldValue);
            Match  match   = HttpTrailerField._regex.Match(@string);

            if (!match.Success)
            {
                return;
            }
            this.SetFieldNames(MatchExtensions.GroupCapturesValues(match, "FieldName"));
        }
        internal HttpTransferEncodingField(byte[] fieldValue)
            : base("Transfer-Encoding", (IList <byte>)fieldValue)
        {
            string @string = HttpRegex.GetString(fieldValue);
            Match  match   = HttpTransferEncodingField._regex.Match(@string);

            if (!match.Success)
            {
                return;
            }
            this.SetTransferCodings((IList <string>)Enumerable.ToArray <string>(MatchExtensions.GroupCapturesValues(match, "TransferCoding")));
        }
        internal HttpTransferEncodingField(byte[] fieldValue)
            : base(FieldName, fieldValue)
        {
            string fieldValueString = HttpRegex.GetString(fieldValue);
            Match  match            = _regex.Match(fieldValueString);

            if (!match.Success)
            {
                return;
            }

            SetTransferCodings(match.GroupCapturesValues(RegexTransferCodingGroupName).ToArray());
        }
Exemplo n.º 4
0
        internal HttpTrailerField(byte[] fieldValue)
            : base(FieldName, fieldValue)
        {
            string fieldValueString = HttpRegex.GetString(fieldValue);
            Match  match            = _regex.Match(fieldValueString);

            if (!match.Success)
            {
                return;
            }

            SetFieldNames(match.GroupCapturesValues(FieldNameGroupName));
        }
        internal HttpContentTypeField(byte[] fieldValue)
            : base("Content-Type", (IList <byte>)fieldValue)
        {
            string @string = HttpRegex.GetString(fieldValue);
            Match  match   = HttpContentTypeField._regex.Match(@string);

            if (!match.Success)
            {
                return;
            }
            this.MediaType    = Enumerable.First <Capture>(Enumerable.Cast <Capture>((IEnumerable)match.Groups["MediaType"].Captures)).Value;
            this.MediaSubtype = Enumerable.First <Capture>(Enumerable.Cast <Capture>((IEnumerable)match.Groups["MediaSubType"].Captures)).Value;
            this.Parameters   = new HttpFieldParameters(MatchExtensions.GroupCapturesValues(match, "ParameterName"), MatchExtensions.GroupCapturesValues(match, "ParameterValue"));
        }
        internal HttpContentTypeField(byte[] fieldValue)
            : base(FieldName, fieldValue)
        {
            string fieldValueString = HttpRegex.GetString(fieldValue);
            Match  match            = _regex.Match(fieldValueString);

            if (!match.Success)
            {
                return;
            }

            MediaType    = match.Groups[MediaTypeGroupName].Captures.Cast <Capture>().First().Value;
            MediaSubtype = match.Groups[MediaSubTypeGroupName].Captures.Cast <Capture>().First().Value;
            Parameters   = new HttpFieldParameters(match.GroupCapturesValues(HttpRegex.ParameterNameGroupName),
                                                   match.GroupCapturesValues(HttpRegex.ParameterValueGroupName));
        }
Exemplo n.º 7
0
 public static string GetString(byte[] buffer)
 {
     return(HttpRegex.GetString(buffer, 0, buffer.Length));
 }