0

I am trying to send a tuple from Python to Java using msgpack but I do not seem to be able of doing it

This is the code in Python

tuple_data = (12,  "ajonjoli", 554)
new_file = open("/tmp/tuple_ser.bin", "wb")
msgpack.pack(tuple_data, new_file)

Whenever I try to unpack it in Java I get an exception (org.msgpack.core.MessageInsufficientBufferException)

Is this possible at all?

Note: I can make it work with a dictionary in Python and a Map in Java

Thanks

JAC
  • 287
  • 1
  • 10
  • will json do? it can be used in multiple programming languages and easy also – Ja8zyjits Mar 18 '19 at 11:40
  • JSON would definitely do it but I have only partial control on what the Python side is sending – JAC Mar 18 '19 at 11:41
  • 3
    Possible unrelated, but, are you closing the file after write (new_file.close() or using with clause) ? – jgoday Mar 18 '19 at 11:42
  • can you write down the basic java code..to get an understanding of how you are doing it. Since the error is in java we need to know what went wrong there – Ja8zyjits Mar 18 '19 at 11:45
  • @jgoday Not unrelated at all. That was causing it – JAC Mar 18 '19 at 11:56

0 Answers0