/* * Closes this writer. If a {@link PipedReader} is connected to this writer, * it is closed as well and the pipe is disconnected. Any data buffered in * the reader can still be read. * * @throws IOException * if an error occurs while closing this writer. */ public override void close()// throws IOException { { lock (lockJ) { /* Is the pipe connected? */ if (dest != null) { dest.done(); dest = null; } closed = true; } }
/* * Connects this {@code PipedWriter} to a {@link PipedReader}. Any data * written to this writer becomes readable in the reader. * * @param stream * the reader to connect to. * @throws IOException * if this writer is closed or already connected, or if {@code * stream} is already connected. */ public void connect(PipedReader stream)//throws IOException { { lock (lockJ) { if (this.dest != null) { throw new IOException("Already connected"); //$NON-NLS-1$ } if (closed) { throw new IOException("Pipe is closed"); //$NON-NLS-1$ } stream.establishConnection(); this.dest = stream; } }
/** * Closes this writer. If a {@link PipedReader} is connected to this writer, * it is closed as well and the pipe is disconnected. Any data buffered in * the reader can still be read. * * @throws IOException * if an error occurs while closing this writer. */ public override void close() { // throws IOException { lock (lockJ) { /* Is the pipe connected? */ if (dest != null) { dest.done(); dest = null; } closed = true; } }
//throws IOException { /** * Constructs a new {@code PipedWriter} connected to the {@link PipedReader} * {@code dest}. Any data written to this writer can be read from {@code * dest}. * * @param dest * the {@code PipedReader} to connect to. * @throws IOException * if {@code dest} is already connected. */ public PipedWriter(PipedReader dest) : base(dest) { connect(dest); }
/** * Connects this {@code PipedWriter} to a {@link PipedReader}. Any data * written to this writer becomes readable in the reader. * * @param stream * the reader to connect to. * @throws IOException * if this writer is closed or already connected, or if {@code * stream} is already connected. */ public void connect(PipedReader stream) { //throws IOException { lock (lockJ) { if (this.dest != null) { throw new IOException("Already connected"); //$NON-NLS-1$ } if (closed) { throw new IOException("Pipe is closed"); //$NON-NLS-1$ } stream.establishConnection(); this.dest = stream; } }
/* * Constructs a new {@code PipedWriter} connected to the {@link PipedReader} * {@code dest}. Any data written to this writer can be read from {@code * dest}. * * @param dest * the {@code PipedReader} to connect to. * @throws IOException * if {@code dest} is already connected. */ public PipedWriter(PipedReader dest) ://throws IOException { base(dest) { connect(dest); }