Comply with stream protocol.
Merge pull request #8 from Raynos/patch-2

Comply with stream protocol.