implemented stream#flush