Fix 100% CPU bug by detecting when the underlying stream is over.
Fix 100% CPU bug by detecting when the underlying stream is over.

Ryezhang/stronglink,iOSCowboy/stronglink,nkatsaros/stronglink,btrask/stronglink,nkatsaros/stronglink,Lacra17/stronglink,shaunstanislaus/stronglink,rmoorman/stronglink,nkatsaros/stronglink,btrask/stronglink,Lacra17/stronglink,feld/stronglink,iOSCowboy/stronglink,shaunstanislaus/stronglink,shaunstanislaus/stronglink,guiquanz/stronglink,feld/stronglink,Lacra17/stronglink,guiquanz/stronglink,iOSCowboy/stronglink,yamingd/stronglink,feld/stronglink,btrask/stronglink,yamingd/stronglink,Ryezhang/stronglink,Ryezhang/stronglink,btrask/stronglink,rmoorman/stronglink,yamingd/stronglink,rmoorman/stronglink,guiquanz/stronglink