home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / CHIPHEFT062001.ISO / browser / nc32lyc / comm.z / java40.jar / netscape / net / URLOutputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-08-15  |  1.2 KB  |  42 lines

  1. package netscape.net;
  2.  
  3. import java.io.IOException;
  4. import java.io.OutputStream;
  5.  
  6. final class URLOutputStream extends OutputStream {
  7.    final URLConnection connection;
  8.  
  9.    public URLOutputStream(URLConnection var1) {
  10.       System.getSecurityManager().checkURLConnect(((java.net.URLConnection)var1).getURL());
  11.       this.connection = var1;
  12.    }
  13.  
  14.    protected native void open() throws IOException;
  15.  
  16.    public native void write(int var1) throws IOException;
  17.  
  18.    public void write(byte[] var1) throws IOException {
  19.       this.writeBytes(var1, 0, var1.length);
  20.    }
  21.  
  22.    public void write(byte[] var1, int var2, int var3) throws IOException {
  23.       this.writeBytes(var1, var2, var3);
  24.    }
  25.  
  26.    private native void writeBytes(byte[] var1, int var2, int var3) throws IOException;
  27.  
  28.    public void close() throws IOException {
  29.       this.pClose();
  30.       this.connection.currentOutputStream = null;
  31.    }
  32.  
  33.    public native void pClose() throws IOException;
  34.  
  35.    protected void finalize() {
  36.       try {
  37.          this.close();
  38.       } catch (IOException var1) {
  39.       }
  40.    }
  41. }
  42.