private static HttpResponseDatagram.ParseInfo Parse(byte[] buffer, int offset, int length)
        {
            HttpParser  httpParser = new HttpParser(buffer, offset, length);
            HttpVersion version;
            uint?       number;
            Datagram    reasonPhrase;

            httpParser.Version(out version).Space().DecimalNumber(3, out number).Space().SkipSpaces().ReasonPhrase(out reasonPhrase).CarriageReturnLineFeed();
            HttpResponseDatagram.ParseInfo parseInfo1 = new HttpResponseDatagram.ParseInfo();
            parseInfo1.Length       = length;
            parseInfo1.Version      = version;
            parseInfo1.StatusCode   = number;
            parseInfo1.ReasonPhrase = reasonPhrase;
            HttpResponseDatagram.ParseInfo parseInfo2 = parseInfo1;
            if (!httpParser.Success)
            {
                return(parseInfo2);
            }
            int        num1 = httpParser.Offset - offset;
            int?       endOffset;
            HttpHeader header = new HttpHeader((IEnumerable <KeyValuePair <string, IEnumerable <byte> > >)HttpDatagram.GetHeaderFields(out endOffset, buffer, offset + num1, length - num1));

            parseInfo2.Header = header;
            if (!endOffset.HasValue)
            {
                return(parseInfo2);
            }
            int      num2     = endOffset.Value - offset - num1;
            Datagram datagram = HttpDatagram.ParseBody(buffer, offset + num1 + num2, length - num1 - num2, HttpResponseDatagram.IsBodyPossible(number.Value), header);

            parseInfo2.Body   = datagram;
            parseInfo2.Length = num1 + num2 + datagram.Length;
            return(parseInfo2);
        }
 internal HttpResponseDatagram(byte[] buffer, int offset, int length)
     : this(buffer, offset, HttpResponseDatagram.Parse(buffer, offset, length))
 {
 }