home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / io / FileOutputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.4 KB  |  86 lines

  1. package java.io;
  2.  
  3. public class FileOutputStream extends OutputStream {
  4.    // $FF: renamed from: fd java.io.FileDescriptor
  5.    private FileDescriptor field_0;
  6.  
  7.    public FileOutputStream(String var1) throws FileNotFoundException {
  8.       this(var1, false);
  9.    }
  10.  
  11.    public FileOutputStream(String var1, boolean var2) throws FileNotFoundException {
  12.       SecurityManager var3 = System.getSecurityManager();
  13.       if (var3 != null) {
  14.          var3.checkWrite(var1);
  15.       }
  16.  
  17.       this.field_0 = new FileDescriptor();
  18.       if (var2) {
  19.          this.openAppend(var1);
  20.       } else {
  21.          this.open(var1);
  22.       }
  23.  
  24.    }
  25.  
  26.    public FileOutputStream(File var1) throws FileNotFoundException {
  27.       this(var1.getPath());
  28.    }
  29.  
  30.    public FileOutputStream(FileDescriptor var1) {
  31.       SecurityManager var2 = System.getSecurityManager();
  32.       if (var1 == null) {
  33.          throw new NullPointerException();
  34.       } else {
  35.          if (var2 != null) {
  36.             var2.checkWrite(var1);
  37.          }
  38.  
  39.          this.field_0 = var1;
  40.       }
  41.    }
  42.  
  43.    private native void open(String var1) throws FileNotFoundException;
  44.  
  45.    private native void openAppend(String var1) throws FileNotFoundException;
  46.  
  47.    public native void write(int var1) throws IOException;
  48.  
  49.    private native void writeBytes(byte[] var1, int var2, int var3) throws IOException;
  50.  
  51.    public void write(byte[] var1) throws IOException {
  52.       this.writeBytes(var1, 0, var1.length);
  53.    }
  54.  
  55.    public void write(byte[] var1, int var2, int var3) throws IOException {
  56.       this.writeBytes(var1, var2, var3);
  57.    }
  58.  
  59.    public native void close() throws IOException;
  60.  
  61.    public final FileDescriptor getFD() throws IOException {
  62.       if (this.field_0 != null) {
  63.          return this.field_0;
  64.       } else {
  65.          throw new IOException();
  66.       }
  67.    }
  68.  
  69.    protected void finalize() throws IOException {
  70.       if (this.field_0 != null) {
  71.          if (this.field_0 != FileDescriptor.out && this.field_0 != FileDescriptor.err) {
  72.             this.close();
  73.          } else {
  74.             ((OutputStream)this).flush();
  75.          }
  76.       }
  77.  
  78.    }
  79.  
  80.    private static native void initIDs();
  81.  
  82.    static {
  83.       initIDs();
  84.    }
  85. }
  86.