     source_type = TypeManager.type_spec(t.source)
     [typed_encoder(value, t.descriptor), typed_encoder(value, source_type)]
   end
-  def typed_encoder(_value, [%Descriptor{name: name} = d], _in_array) do
+  def typed_encoder(_value, [%Descriptor{name: name} = _d], _in_array) do
     # constructor = 0, descriptor name as string
     # Logger.info "encode descriptor with name #{inspect name}"
     [<<0x0>>, typed_encoder(name, TypeManager.type_spec("symbol"))]

  end

  def decode_map(value, count) do
    {list, <<>>} = 1..(div(count, 2)) |>
    Enum.reduce({%{}, value}, fn _, {map, bytes} ->
      {key, rem1} = decode_bin(bytes)
      {value, remaining} = decode_bin(rem1)
      {Map.put(map, key, value), remaining}
    end)
  end

  def decode_array(con, size, count, value_bytes) do
    if con == 0x00 do
      {type, bin} = decode_bin(value_bytes)
      <<value :: binary-size(size), rest :: binary>> = bin
    else
      <<value :: binary-size(size), rest :: binary>> = value_bytes
    end
    {list, <<>>} = 1..count |>
    Enum.reduce({[], value}, fn _, {l, bytes} ->
      {elem, remaining} = if con == 0x00 do

  def primitive_encoder(value, %Type{class: :primitive, name: "boolean"}, true) do
    if value == true, do: <<1 :: size(8)>>, else: <<0 :: size(8)>>
  end
  def primitive_encoder(value, %Type{class: :primitive, name: "char"}, in_array) do
    if in_array, do: <<value :: utf32>>, else: <<0x73, value :: utf32>>
  end
  def primitive_encoder(value, %Type{class: :primitive, name: "timestamp"}, in_array) do
    # timestamp = 64 bit unsigned integer
    if in_array, do: <<value :: size(64)>>, else: <<0x83, value :: size(64)>>
  end
