1 // PipedWriter.java - Piped character stream.
3 /* Copyright (C) 1998, 1999 Red Hat, Inc.
5 This file is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
14 * @author Tom Tromey <tromey@cygnus.com>
15 * @date September 25, 1998
18 /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
19 * "The Java Language Specification", ISBN 0-201-63451-1
20 * Status: Complete to 1.1.
23 public class PipedWriter
extends Writer
25 public void close () throws IOException
30 public void connect (PipedReader sink
) throws IOException
33 throw new IOException ("already closed");
38 throw new IOException ("already connected");
52 public void flush () throws IOException
54 // We'll throw an exception if we're closed, but there's nothing
57 throw new IOException ("closed");
66 public PipedWriter (PipedReader sink
) throws IOException
73 public void write (char buffer
[], int offset
, int count
) throws IOException
76 throw new IOException ("closed");
77 reader
.receive(buffer
, offset
, count
);
85 // The associated reader.
86 private PipedReader reader
;
87 private boolean closed
;