readInt does not read the string and convert the string to a number; it reads the input as *bytes.
Below code reads four input bytes and returns an int value:
(((a & 0xff) << 24) | ((b & 0xff) << 16) |
((c & 0xff) << 8) | (d & 0xff))
Use readInt to read bytes which are written by the writeInt method of interface DataOutput.
In you case when you read input 12 on Windows what happens is:
49 - '1'
50 - '2'
13 - carriage return
10 - line feed
As you run this, it does 49 * 2 ^ 24 + 50 * 2 ^ 16 + 13 * 2 ^ 8 + 10 and the output you get is 825363722. Better go for a simple Scanner to read input.
Interested in Java? Check out this Java tutorial by Intellipaat.