is new.
java.lang.Objectjava.io.Writer
java.io.PipedWriter
public class PipedWriter
Piped character-output streams.
| Field Summary |
|---|
| Fields inherited from class java.io. Writer |
|---|
| lock |
| Constructor Summary | |
|---|---|
|
PipedWriter
() Creates a piped writer that is not yet connected to a piped reader. |
|
|
PipedWriter
(
PipedReader
snk) Creates a piped writer connected to the specified piped reader. |
|
| Method Summary | |
|---|---|
| void |
close
() Closes this piped output stream and releases any system resources associated with this stream. |
| void |
connect
(
PipedReader
snk) Connects this piped writer to a receiver. |
| void |
flush
() Flushes this output stream and forces any buffered output characters to be written out. |
| void |
write
(char[] cbuf, int off, int len) Writes len characters from the specified character array starting at offset off to this piped output stream. |
| void |
write
(int c) Writes the specified char to the piped output stream. |
| Methods inherited from class java.io. Writer |
|---|
| append , append , append , write , write , write |
| Methods inherited from class java.lang. Object |
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
| Constructor Detail |
|---|
public PipedWriter(PipedReader snk)
throws IOException
public PipedWriter()
| Method Detail |
|---|
public void connect(PipedReader snk)
throws IOException
If snk is an unconnected piped reader and src is an unconnected piped writer, they may be connected by either the call:
or the call:src.connect(snk)
The two calls have the same effect.snk.connect(src)
public void write(int c)
throws IOException
Implements the write method of Writer.
the pipe is
broken
,
unconnected
, closed or
an I/O error occurs.
public void write(char[] cbuf,
int off,
int len)
throws IOException
This method blocks until all the characters are written to the output stream.
If a thread was reading data characters from the connected piped input stream, but the thread is no longer alive, then an IOException is thrown.
the pipe is
broken
,
unconnected
, closed or
an I/O error occurs.
public void flush()
throws IOException
the pipe is closed, or
an I/O error occurs.
public void close()
throws IOException