stream io the operations supported by buffered writers includewrite(byteswrites the bytes-like data and returns the number of bytes written flush(this method forces the bytes held in the buffer into the raw stream text stream classes the text stream classes are the textiobase class and its two subclasses textiowrapper and stringio textiobase this is the root class for all text stream classes it provides character and line based interface to stream / this class provides several additional methods to that defined in its parent classread(size=- this method will return at most size characters from the stream as single string if size is negative or noneit will read all remaining data readline(size=- this method will return string representing the current line (up to newline or the end of the data whichever comes firstif the stream is already at eofan empty string is returned if size is specifiedat most size characters will be read seek(offset[whence]change the stream position/pointer by the specified offset the optional whence parameter indicates where the seek should start fromseek_set or (the defaultseek from the start of the stream seek_cur or seek to the current positionoffset must be zerowhich is no-operation seek_end or seek to the end of the streamoffset must be zero tell(returns the current stream position/pointer as an opaque number the number does not usually represent number of bytes in the underlying binary storage write(sthis method will write the string to the stream and return the number of characters written textiowrapper this is buffered text stream that wraps buffered binary stream and is direct subclass of textiobase when textiowrapper is created there are range of options available to control its behaviourio textiowrapper(bufferencoding=noneerrors=nonenewline=no neline_buffering=falsewrite_through=false