Class java.io.OutputStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.io.OutputStream

Object
   |
   +----java.io.OutputStream

public abstract class OutputStream
extends Object
This abstract class is the superclass of all classes representing an output stream of bytes.

Applications that need to define a subclass of OutputStream must always provide at least a method that writes one byte of output.

Version:
1.15, 07/01/98
Author:
Arthur van Hoff
Since:
JDK1.0
See Also:
BufferedOutputStream, ByteArrayOutputStream, DataOutputStream, FilterOutputStream, InputStream, write(int)

Constructor Index

 o java.io.OutputStream()

Method Index

 o close()
Closes this output stream and releases any system resources associated with this stream.
 o flush()
Flushes this output stream and forces any buffered output bytes to be written out.
 o write(int)
Writes the specified byte to this output stream.
 o write(byte[])
Writes b.length bytes from the specified byte array to this output stream.
 o write(byte[], int, int)
Writes len bytes from the specified byte array starting at offset off to this output stream.

Constructors

 o OutputStream
public OutputStream()

Methods

 o close
public void close() throws IOException
Closes this output stream and releases any system resources associated with this stream.

The close method of OutputStream does nothing.

Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o flush
public void flush() throws IOException
Flushes this output stream and forces any buffered output bytes to be written out.

The flush method of OutputStream does nothing.

Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o write
public abstract void write(int b) throws IOException
Writes the specified byte to this output stream.

Subclasses of OutputStream must provide an implementation for this method.

Parameters:
b - the byte.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o write
public void write(byte b) throws IOException
Writes b.length bytes from the specified byte array to this output stream.

The write method of OutputStream calls the write method of three arguments with the three arguments b, 0, and b.length.

Parameters:
b - the data.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
See Also:
write(byte[], int, int)
 o write
public void write(byte b,
                  int off,
                  int len) throws IOException
Writes len bytes from the specified byte array starting at offset off to this output stream.

The write method of OutputStream calls the write method of one argument on each of the bytes to be written out. Subclasses are encouraged to override this method and provide a more efficient implementation.

Parameters:
b - the data.
off - the start offset in the data.
len - the number of bytes to write.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0

All Packages  Class Hierarchy  This Package  Previous  Next  Index