The Output Stream class

The java.io.OutputStream class sends raw bytes of data to a target such as the console or a network server. OutputStream is an abstract class.

 public abstract class OutputStream extends Object

However, many methods in the class library are only specified to return OutputStream rather than the more specific subclass. Furthermore, many of the methods of OutputStream are generally useful. These are:

 public abstract void write(int b) throws IOException
 public void write(byte[] data) throws IOException
 public void write(byte[] data, int offset, int length) throws IOException
 public void flush() throws IOException
 public void close() throws IOException

The write() methods send raw bytes of data to whomever is listening to this stream.


Copyright 2000 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified January 28, 2000