The OutputStream Class

The OutputStream class is an abstract class that lays the foundation for the byte output stream hierarchy. It provides a set of methods that are the output analog to the InputStream methods.

The write() Method

The write() method enables bytes to be written to the output stream. It provides three overloaded forms to write a single byte, an array of bytes, or a segment of an array. The write() method, like the read() method, can block when it tries to write to a stream. The blocking causes the thread executing the write() method to wait until the write operation has been completed.

The flush() Method

The flush() method causes any buffered data to be immediately written to the output stream. Some subclasses of OutputStream ...

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.