Hey folks,
I have an Elixir application that communicates with a Java application through ports.
For communication, I convert values into binary format using :erlang.term_to_binary/1
.
However, I’ve noticed that when :erlang.term_to_binary/1
receives a list of integers, it returns an incorrect binary.
For example:
Input: [2]
Expected: <<131, 108, 0, 0, 0, 1, 97, 2, 106>>
Result: <<131, 107, 0, 1, 2>>
Can anyone help me avoid this issue?
Thank you
Best regards,
Kalle