How to read String in java that was written using python's struct.pack method
<p>I have written information to a file in python using struct.pack
eg.</p>

<pre><code>out.write( struct.pack("&gt;f", 1.1) );
out.write( struct.pack("&gt;i", 12) );
out.write( struct.pack("&gt;3s", "abc") );
</code></pre>

<p>Then I read it in java using <code>DataInputStream</code> and <code>readInt</code>, <code>readFloat</code> and <code>readUTF</code>.
Reading the numbers works but as soon as I call <code>readUTF()</code> I get <code>EOFException</code>.</p>

<p>I assume this is because of the differences in the format of the string being written and the way java reads it, or am I doing something wrong?</p>

<p>If they are incompatible, is there another way to read and write strings?</p>
