I want to redirect stdin like this
java foo < test.txt
and read test.txt byte by byte in a function. I just want to do this:
FileInputStream f = new FileInputStream(System.in)
This should be incredibly simple but I've been pounding my head because I cannot figure out a way to grab test.txt without using args[x].
Edit: The issue is that I'm doing this:
FileInputStream readByte = new FileInputStream(file);
char c = (char)readByte.read();
It does not give the same thing as
char c = System.in.read();