This is where I write a new textfile to input into the binary file. The hiscores class is a normal class that has file input and output methods (working as intended).
Hiscores hs = new Hiscores();
String testString = new String
("1000 0900 0800 0700 0600 0700 0400 0300 0200 0100 " +
"one†two†three†four†five†six†seven†eight†nine†ten"
);
hs.WriteBinary(testString);
and this is the second part of the code where I read it.
byte[] hsInfo = hs.ReadBinary();
int a,b;
int[] scoreValue = new int[10];
for(a = 0; a < 50; a+=5){
scoreValue[a/5] = hsInfo[a]*1000 - 48000 + hsInfo[a+1]*100 - 5300 + hsInfo[a+2] * 10 -20 + hsInfo[a+3] - 8;
}
I get exactly the right result but why did I have to subtract those numbers such as 48000 to get the right numbers. This is really puzzling. I think it has something to do with the unicodevalues or something but I can't just figure this out :/