java::io::BufferedOutputStream Class Reference

Inheritance diagram for java::io::BufferedOutputStream:

Inheritance graph
java::lang::Objectjava::lang::Interfacejava::io::OutputStream
[legend]
Collaboration diagram for java::io::BufferedOutputStream:

Collaboration graph
java::lang::Objectjava::lang::Interfacejava::lang::ObjectRefjava::io::OutputStreamjava::lang::Comparable
[legend]

List of all members.


Detailed Description

This class is the superclass of all classes that filter output streams.

These streams sit on top of an already existing output stream (the underlying output stream) which it uses as its basic sink of data, but possibly transforming the data along the way or providing additional functionality.

The class BufferedOutputStream itself simply overrides all methods of OutputStream with versions that pass all requests to the underlying output stream. Subclasses of BufferedOutputStream may further override some of these methods as well as provide additional methods and fields.

Author:
Jonathan Payne
Version:
1.28, 02/02/00
Since:
JDK1.0

Public Member Functions

 BufferedOutputStream (const Ref< OutputStream > &out=0, jint size=512)
 Creates an output stream filter built on top of the specified underlying output stream.
virtual void write (jint b)
 Writes the specified byte to this output stream.
virtual void write (const Array< jbyte > &b, jint off=0, jint len=-1)
 Writes len bytes from the specified byte array starting at offset off to this output stream.
virtual void flush ()
 Flushes this output stream and forces any buffered output bytes to be written out to the stream.
virtual void close ()
 Closes this output stream and releases any system resources associated with the stream.

Constructor & Destructor Documentation

java::io::BufferedOutputStream::BufferedOutputStream ( const Ref< OutputStream > &  out = 0,
jint  size = 512 
)

Creates an output stream filter built on top of the specified underlying output stream.

Parameters:
out the underlying output stream to be assigned to the field this.out for later use, or null if this instance is to be created without an underlying stream.


Member Function Documentation

virtual void java::io::BufferedOutputStream::write ( jint  b  )  [virtual]

Writes the specified byte to this output stream.

The write method of BufferedOutputStream calls the write method of its underlying output stream, that is, it performs out.write(b).

Implements the abstract write method of OutputStream.

Parameters:
b the byte.
Exceptions:
IOException if an I/O error occurs.

Implements java::io::OutputStream.

virtual void java::io::BufferedOutputStream::write ( const Array< jbyte > &  b,
jint  off = 0,
jint  len = -1 
) [virtual]

Writes len bytes from the specified byte array starting at offset off to this output stream.

The write method of BufferedOutputStream calls the write method of one argument on each byte to output.

Note that this method does not call the write method of its underlying input stream with the same arguments. Subclasses of BufferedOutputStream should provide a more efficient implementation of this method.

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

Implements java::io::OutputStream.

virtual void java::io::BufferedOutputStream::flush (  )  [virtual]

Flushes this output stream and forces any buffered output bytes to be written out to the stream.

The flush method of BufferedOutputStream calls the flush method of its underlying output stream.

Exceptions:
IOException if an I/O error occurs.

Reimplemented from java::io::OutputStream.

virtual void java::io::BufferedOutputStream::close (  )  [virtual]

Closes this output stream and releases any system resources associated with the stream.

The close method of BufferedOutputStream calls its flush method, and then calls the close method of its underlying output stream.

Exceptions:
IOException if an I/O error occurs.

Reimplemented from java::io::OutputStream.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:26 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3