Use stream to handle local file.
Remove an unused import.
Merge pull request #668 from ayanamist/bugfix

Use stream to handle local file.