// setFixedHeader sets the fixed header to the Packet.
547412
func (p *SUBSCRIBE) setFixedHeader() {
	// Append the first byte to the fixed header.
	p.fixedHeader = append(p.fixedHeader, TypeSUBSCRIBE<<4|0x02)

	// Append the Remaining Length to the fixed header.
	p.appendRemainingLength()
}
391198
func (r *Response) AddHeader(key, value string) *Response {
	r.Header.Add(key, value)
	return r
}
736432
func (p *CONNECT) setVariableHeader() {
	// Convert the Keep Alive to the slice.
	keepAlive := encodeUint16(p.keepAlive)

	// Create a variable header and set it to the Packet.
	p.variableHeader = []byte{
		0x00,             // Length MSB (0)
		0x04,             // Length LSB (4)
		0x4D,             // 'M'
		0x51,             // 'Q'
		0x54,             // 'T'
		0x54,             // 'T'
		0x04,             // Level(4)
		p.connectFlags(), // Connect Flags
		keepAlive[0],     // Keep Alive MSB
		keepAlive[1],     // Keep Alive LSB
	}
}
1197004
func (s *DescribeOfferingOutput) SetFixedPrice(v float64) *DescribeOfferingOutput {
	s.FixedPrice = &v
	return s
}
799826
func (s *SamplingRuleUpdate) SetFixedRate(v float64) *SamplingRuleUpdate {
	s.FixedRate = &v
	return s
}
921373
func SetResponseHeaderValues(resp *http.Response, h string, values []string) {
	if resp.Header == nil {
		resp.Header = make(http.Header)
	}
	for _, v := range values {
		resp.Header.Add(h, v)
	}
}
124685
func (s *VideoDescription) SetFixedAfd(v int64) *VideoDescription {
	s.FixedAfd = &v
	return s
}
567504
func (p *SUBSCRIBE) setVariableHeader() {
	// Append the Packet Identifier to the variable header.
	p.variableHeader = append(p.variableHeader, encodeUint16(p.PacketID)...)
}
399308
func NewControlPacketWithHeader(fh *FixedHeader) (cp ControlPacket) {
	if fh.MessageType == 0 && fh.MessageType > MaxMessageType {
		return nil
	}
	pooled := packetPools[fh.MessageType-1].Get()
	if pooled == nil {
		cp := newControlPacketWithHeader(fh)
		fh.selfPtr = cp
		return cp
	}

	switch fh.MessageType {
	case Connect:
		cp := pooled.(*ConnectPacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Connack:
		cp := pooled.(*ConnackPacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Disconnect:
		cp := pooled.(*DisconnectPacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Publish:
		cp := pooled.(*PublishPacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Puback:
		cp := pooled.(*PubackPacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Pubrec:
		cp := pooled.(*PubrecPacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Pubrel:
		cp := pooled.(*PubrelPacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Pubcomp:
		cp := pooled.(*PubcompPacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Subscribe:
		cp := pooled.(*SubscribePacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Suback:
		cp := pooled.(*SubackPacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Unsubscribe:
		cp := pooled.(*UnsubscribePacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Unsuback:
		cp := pooled.(*UnsubackPacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Pingreq:
		cp := pooled.(*PingreqPacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	case Pingresp:
		cp := pooled.(*PingrespPacket)
		cp.FixedHeader = fh
		fh.selfPtr = cp
		return cp
	default:
		return nil
	}
}
974184
func (self *simplePBundle) SetReturnHeader(k string, v string) {
	self.out[k] = v
}
1046300
func (c *GroupPercentSetCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}
529147
func (s *VideoParameters) SetFixedGOP(v string) *VideoParameters {
	s.FixedGOP = &v
	return s
}
67918
func (s *SamplingRule) SetFixedRate(v float64) *SamplingRule {
	s.FixedRate = &v
	return s
}
1220883
func SetRequestHeader(key, val string) ClientRequestFunc {
	return func(ctx context.Context, md *metadata.MD) context.Context {
		key, val := EncodeKeyValue(key, val)
		(*md)[key] = append((*md)[key], val)
		return ctx
	}
}
1366483
func (p *PUBCOMP) setVariableHeader() {
	// Append the Packet Identifier to the variable header.
	p.variableHeader = append(p.variableHeader, encodeUint16(p.PacketID)...)
}
427378
func (b *Block) resolveHeader(ctx context.Context) (*types.Header, error) {
	if b.num == nil && b.hash == (common.Hash{}) {
		return nil, BlockInvariantError
	}

	if b.header == nil {
		if _, err := b.resolve(ctx); err != nil {
			return nil, err
		}
	}
	return b.header, nil
}
228241
func NewControlPacketWithHeader(fh FixedHeader) (cp ControlPacket) {
	switch fh.MessageType {
	case Connect:
		cp = &ConnectPacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Connack:
		cp = &ConnackPacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Disconnect:
		cp = &DisconnectPacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Publish:
		cp = &PublishPacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Puback:
		cp = &PubackPacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Pubrec:
		cp = &PubrecPacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Pubrel:
		cp = &PubrelPacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Pubcomp:
		cp = &PubcompPacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Subscribe:
		cp = &SubscribePacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Suback:
		cp = &SubackPacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Unsubscribe:
		cp = &UnsubscribePacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Unsuback:
		cp = &UnsubackPacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Pingreq:
		cp = &PingreqPacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	case Pingresp:
		cp = &PingrespPacket{FixedHeader: fh, uuid: uuid.NewUUID()}
	default:
		return nil
	}
	return cp
}