I am using the Scanner utility in Java to input data from a file like so:
File file = new File("mazes.txt");
Scanner scan = new Scanner(file);
scan.useDelimiter("__________\n");
String record = scan.next();
but it is changing certain bytes to other bytes. For example, where the record string should be a byte with hexadecimal value 80, Scanner seems to turn this into a byte with a hex value of ac. How can I input records from the file without any switching of the bytes like this?
From the documentation of the constructor:
If your file has another encoding, you must use (e.g.):
or
etc.