Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython
by Richard Hightower
Text Streams
All of the text-oriented classes are derived from Reader and Writer. By understanding them, you'll have a handle on dealing with their descendents.
Writer
The Writer class writes character data to a stream. It has the following methods:
write(c)— writes a single character to the text stream
write(cbuf)— writes a sequence of characters to the text stream
write(cbuf, off, len)— writes a sequence of characters to the text stream starting at the offset into the stream and copying to len in the buffer
write(str)— writes out a string to the text stream
write(str, off, len)— writes out a string from the given offset to the given length
close()— closes the text stream
flush()— flushes the content of the text stream; used if the stream supports ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access