private PreparedHeader(PreparedHeaderName name, string value, byte[] valueEncoded, uint http2StaticIndex) { Value = value; _name = name; _value = valueEncoded; int http1EncodedLen = Http1Connection.GetEncodeHeaderLength(name._http1Encoded, valueEncoded); _http1Encoded = new byte[http1EncodedLen]; Http1Connection.EncodeHeader(name._http1Encoded, valueEncoded, _http1Encoded); _http2Encoded = http2StaticIndex != 0 ? HPack.EncodeIndexedHeader(http2StaticIndex) : name._http2StaticIndex != 0 ? HPack.EncodeHeaderWithoutIndexing(name._http2StaticIndex, valueEncoded) : HPack.EncodeHeaderWithoutIndexing(name._http2Encoded, valueEncoded); _http2StaticIndex = http2StaticIndex; }