An OutputStream
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
Many methods in the
class library are only specified to return OutputStream
rather than
the more specific subclass so you tend to
use polymorphism.
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.