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

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

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.io.PipedOutputStream

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

public class PipedOutputStream
extends OutputStream
A piped output stream is the sending end of a communications pipe. Two threads can communicate by having one thread send data through a piped output stream and having the other thread read the data through a piped input stream.

See Also:
PipedInputStream

Constructor Index

 o PipedOutputStream()
Creates a piped output stream that is not yet connected to a piped input stream.
 o PipedOutputStream(PipedInputStream)
Creates a piped output stream connected to the specified piped input stream.

Method Index

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

Constructors

 o PipedOutputStream
 public PipedOutputStream(PipedInputStream snk) throws IOException
Creates a piped output stream connected to the specified piped input stream.

Parameters:
snk - The piped input stream to connect to.
Throws: IOException
if an I/O error occurs.
 o PipedOutputStream
 public PipedOutputStream()
Creates a piped output stream that is not yet connected to a piped input stream. It must be connected to a piped input stream, either by the receiver or the sender, before being used.

See Also:
connect, connect

Methods

 o connect
 public void connect(PipedInputStream snk) throws IOException
Connects this piped output stream to a receiver.

Parameters:
snk - the piped output stream to connect to.
Throws: IOException
if an I/O error occurs.
 o write
 public void write(int b) throws IOException
Writes the specified byte to the piped output stream.

Parameters:
b - the byte to be written.
Throws: IOException
if an I/O error occurs.
Overrides:
write in class OutputStream
 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 piped output stream.

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.
Overrides:
write in class OutputStream
 o flush
 public synchronized void flush() throws IOException
Flushes this output stream and forces any buffered output bytes to be written out. This will notify any readers that bytes are waiting in the pipe.

Throws: IOException
if an I/O error occurs.
Overrides:
flush in class OutputStream
 o close
 public void close() throws IOException
Closes this piped output stream and releases any system resources associated with this stream.

Throws: IOException
if an I/O error occurs.
Overrides:
close in class OutputStream

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.