override input/outputstream read/write