def to_wire
      content = ''
      @avps.each { |a| content += a.to_wire }
      length_8, length_16 = Internals::UInt24.to_u8_and_u16(content.length + 20)
      code_8, code_16 = Internals::UInt24.to_u8_and_u16(@command_code)
      request_flag = @request ? '1' : '0'
      proxy_flag = @proxyable ? '1' : '0'
      flags_str = "#{request_flag}#{proxy_flag}000000"

      header = [@version, length_8, length_16, flags_str, code_8, code_16, @app_id, @hbh, @ete].pack('CCnB8CnNNN')
      header + content
    end
def to_wire
      content = ''
      @avps.each { |a| content += a.to_wire }
      length_8, length_16 = Internals::UInt24.to_u8_and_u16(content.length + 20)
      code_8, code_16 = Internals::UInt24.to_u8_and_u16(@command_code)
      request_flag = @request ? '1' : '0'
      proxy_flag = @proxyable ? '1' : '0'
      flags_str = "#{request_flag}#{proxy_flag}000000"

      header = [@version, length_8, length_16, flags_str, code_8, code_16, @app_id, @hbh, @ete].pack('CCnB8CnNNN')
      header + content
    end
Serializes a Diameter message (header plus AVPs) into the series
 of bytes representing it on the wire.

 @return [String] The byte-encoded form.