I am doing some File reading... and I am having some problems with a bit of it...
I was having some weird output and it took me a long time to figure it out, it turns out Java doesn't like reading 1000 000 , 1000 0010 , 1001 1101 , and 1001 1111 ... I haven't check all possibilities.
I take the whole file, and read it into a char[] using :
Code:
public BufferReader(File lFile) {
if (lFile.exists() && lFile.isFile() && lFile.canRead()) {
try {
iBuffer = new char[(int) lFile.length()];
Reader lIn = new FileReader(lFile);
lIn.read(iBuffer);
lIn.close();
}
catch ( Exception pEx ) {
iBuffer = null;
pEx.printStackTrace();
}
}
}
It reads it all in and says that it is all good, but when I take a cell that should contain one of the above values, I end up with a value that is >255 (which should be possible I would think)
should read it out as an int and throughout 99% of the file it is fine, but there are 3 bytes that end up with values > 255 and they contain the above values.