home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VPage / Java.bin / CLASSES.ZIP / sun / rmi / transport / proxy / HttpSendInputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-07-08  |  1.6 KB  |  95 lines

  1. package sun.rmi.transport.proxy;
  2.  
  3. import java.io.FilterInputStream;
  4. import java.io.IOException;
  5. import java.io.InputStream;
  6.  
  7. class HttpSendInputStream extends FilterInputStream {
  8.    HttpSendSocket owner;
  9.  
  10.    public HttpSendInputStream(InputStream var1, HttpSendSocket var2) throws IOException {
  11.       super(var1);
  12.       this.owner = var2;
  13.    }
  14.  
  15.    public void deactivate() {
  16.       super.in = null;
  17.    }
  18.  
  19.    public int read() throws IOException {
  20.       if (super.in == null) {
  21.          super.in = this.owner.readNotify();
  22.       }
  23.  
  24.       return super.in.read();
  25.    }
  26.  
  27.    public int read(byte[] var1, int var2, int var3) throws IOException {
  28.       if (var3 == 0) {
  29.          return 0;
  30.       } else {
  31.          if (super.in == null) {
  32.             super.in = this.owner.readNotify();
  33.          }
  34.  
  35.          return super.in.read(var1, var2, var3);
  36.       }
  37.    }
  38.  
  39.    public long skip(long var1) throws IOException {
  40.       if (var1 == 0L) {
  41.          return 0L;
  42.       } else {
  43.          if (super.in == null) {
  44.             super.in = this.owner.readNotify();
  45.          }
  46.  
  47.          return super.in.skip(var1);
  48.       }
  49.    }
  50.  
  51.    public int available() throws IOException {
  52.       if (super.in == null) {
  53.          super.in = this.owner.readNotify();
  54.       }
  55.  
  56.       return super.in.available();
  57.    }
  58.  
  59.    public void close() throws IOException {
  60.       this.owner.close();
  61.    }
  62.  
  63.    public synchronized void mark(int var1) {
  64.       if (super.in == null) {
  65.          try {
  66.             super.in = this.owner.readNotify();
  67.          } catch (IOException var2) {
  68.             return;
  69.          }
  70.       }
  71.  
  72.       super.in.mark(var1);
  73.    }
  74.  
  75.    public synchronized void reset() throws IOException {
  76.       if (super.in == null) {
  77.          super.in = this.owner.readNotify();
  78.       }
  79.  
  80.       super.in.reset();
  81.    }
  82.  
  83.    public boolean markSupported() {
  84.       if (super.in == null) {
  85.          try {
  86.             super.in = this.owner.readNotify();
  87.          } catch (IOException var1) {
  88.             return false;
  89.          }
  90.       }
  91.  
  92.       return super.in.markSupported();
  93.    }
  94. }
  95.