implement feof for native stream