First I write the integer using python:
out.write( struct.pack(">i", int(i)) );
I then read the integer using DataInputStream.readInt()
in Java.
I works but when it tries to read the number 10, and probably some other numbers too,
it starts to read garbage.
Reading the numbers:
0, 4, 5, 0, 5, 13, 10, 1, 5, 6
Java reads:
0, 4, 5, 0, 5, 13, 167772160, 16777216, 83886080
What am I doing wrong?