public static HTTP2FrameHeaderAndPayload CreateSettingsFrame(List <KeyValuePair <HTTP2Settings, UInt32> > settings)
        {
            HTTP2FrameHeaderAndPayload frame = new HTTP2FrameHeaderAndPayload();

            frame.Type          = HTTP2FrameTypes.SETTINGS;
            frame.Flags         = 0;
            frame.PayloadLength = (UInt32)settings.Count * 6;

            frame.Payload = BufferPool.Get(frame.PayloadLength, true);

            for (int i = 0; i < settings.Count; ++i)
            {
                BufferHelper.SetUInt16(frame.Payload, i * 6, (UInt16)settings[i].Key);
                BufferHelper.SetUInt32(frame.Payload, (i * 6) + 2, settings[i].Value);
            }

            return(frame);
        }