int
isn't 2 bytes, it's 4. And writeUTF
writes a 2-byte length prefix, so the total length is supposed to be 18.
If we consider the offsets of each piece of data:
Offset
UTF length 0
Jim 2
9304029 5
UTF length 9
England 11
When you pass in 12, it will try to read a UTF string using ng
as the length, which is 28263, which is obviously a bit longer than your file.