Test end of file only if stream is a ressource