home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.net;
-
- import java.io.IOException;
- import java.io.OutputStream;
-
- class NetPipedOutputStream extends OutputStream {
- private NetPipedInputStream sink;
-
- public NetPipedOutputStream(NetPipedInputStream snk) throws IOException {
- this.connect(snk);
- }
-
- public NetPipedOutputStream() {
- }
-
- public void connect(NetPipedInputStream snk) throws IOException {
- this.sink = snk;
- snk.closed = false;
- snk.connbroken = false;
- snk.in = -1;
- snk.out = 0;
- }
-
- public void write(int b) throws IOException {
- this.sink.receive(b);
- }
-
- public void write(byte[] b, int off, int len) throws IOException {
- this.sink.receive(b, off, len);
- }
-
- public void close() throws IOException {
- if (this.sink != null) {
- this.sink.receivedLast();
- }
-
- }
-
- void breakConn() throws IOException {
- if (this.sink != null) {
- this.sink.connBroken();
- }
-
- }
- }
-