站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档

Class java.io.OutputStream - JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.io.OutputStream

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

See Also:
BufferedOutputStream, ByteArrayOutputStream, DataOutputStream, FilterOutputStream, InputStream, write

Constructor Index

 o 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(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.
 o write(int)
Writes the specified byte to this output stream.

Constructors

 o OutputStream
 public OutputStream()

Methods

 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.
 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.
See Also:
write
 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.
 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.
 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.

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Submit a bug or feature - Version 1.1.8 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1995-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.