And if it’s not JSON because of space restrictions, BERT or something similar could be used, it supports compression out of the box and is not restricted to printable characters.
I’m pretty sure there is a Java implementation out there…
You can even make this converter a port, or use jerlang or what was its name to call Java code directly…
And I never told you to change that. I have understood that you can not change the legacy system.
What we are suggesting is that you write a “third” program in Java, that does the conversion, depending on the type of the value in the map, either write out JSON or XML or BERT (aka Erlang External Term Format).
You have already Java code that shows you how to load the dump. Therefore loading and converting from there is probably the easiest thing to do.
Trying to load the unknown encoding in elixir/erlang code will be a lot of pain. We are just suggesting the easier ways. The BEAM is good in letting other programs work. Use it!
I wouldn’t classify serialized Java objects as a “common data structure”. You’d encounter similar problems trying to use Elixir to read data stored from Ruby’s Marshal, Python’s pickle or PHP’s serialize, all of which are intended for language-specific structure-preserving data storage.
Compare those to Erlang’s external term format, which is extensively documented specifically for interoperating with non-Erlang code.
+1 to writing an adapter program in Java, to let Java handle decoding its own data structures.