handle FSDataInputStream.read() returning -1 on EOF