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 / FileInputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.3 KB  |  75 lines

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