i have 2 very large binary numbers (144 digits). I want to write them in different RandomAccessFiles and then read the files to memory and check to see which number is bigger. What i did so far:
1. I created a BigInteger:
BigInteger big = new BigInteger("01110101010010101010111100010101010101010101010110101010101010101010010101010101010101010101010101111010010101010",2);
2. I get the longValue:
big.longValue();
3.. I write the long to a randomaccessfile,read the files,compare the longs etc...
But if the binary is longer than the 'Long.maxvalue' what i did is wrong, correct?
So does anyone have any suggestions?
Can i handle large binary numbers otherwise?