Fixed closeStreamIdx not flushing unwritten data
Merge pull request #1 from Nitrooo/master

Fixed closeStreamIdx not flushing unwritten data