implement flush()

Add flush to outputstream