home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / TUTORIAL.BIN / NetOutputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-01-30  |  1.2 KB  |  36 lines

  1. package symantec.itools.db.net;
  2.  
  3. import java.io.IOException;
  4. import java.io.OutputStream;
  5.  
  6. class NetOutputStream extends OutputStream {
  7.    protected SocketWriter out;
  8.    short _id;
  9.  
  10.    NetOutputStream(SocketWriter out, short ID) {
  11.       this.out = out;
  12.       this._id = ID;
  13.    }
  14.  
  15.    public void write(int b) throws IOException {
  16.       this.out.write(this._id, b);
  17.    }
  18.  
  19.    public void write(byte[] b) throws IOException {
  20.       this.out.write(this._id, b, 0, b.length);
  21.    }
  22.  
  23.    public void write(byte[] b, int off, int len) throws IOException {
  24.       this.out.write(this._id, b, off, len);
  25.    }
  26.  
  27.    public void flush() throws IOException {
  28.       this.out.flush();
  29.    }
  30.  
  31.    public void close() throws IOException {
  32.       this.flush();
  33.       this.out.close();
  34.    }
  35. }
  36.