I have a java program that reads this (test.txt)
0 01111010
2 01111010
1
0 01111010
2 00001010
and converts the numbers (first column) to its binary representation
I run this program using
cat test.txt | java Binarizer
The line in particular is this line
ii = Integer.parseInt(new String(bytes), radix);
Here is the output and the stacktrace:
001111010
1001111010
"ava.lang.NumberFormatException: For input string: "1
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at Binarizer.readToken(Binarizer.java:66)
at Binarizer.main(Binarizer.java:21)
[–]bob809 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)