O'Reilly logo

Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython by Richard Hightower

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required