to implement outputstream
to implement outputstream