My java program needs to read data from a FIFO file and then block when the data ends and wait for more data.
I can achieve the desired effect with something like
while(true) {
while(myReader.ready()) {
... read data here ....
}
}
... but this eats the cpu. Is there a way to truly do a blocking read on the file while waiting for more data?
Thanks!