Cover stream_write method