home *** CD-ROM | disk | FTP | other *** search
- package java.io;
-
- public class FileInputStream extends InputStream {
- // $FF: renamed from: fd java.io.FileDescriptor
- private FileDescriptor field_0;
-
- public FileInputStream(String var1) throws FileNotFoundException {
- SecurityManager var2 = System.getSecurityManager();
- if (var2 != null) {
- var2.checkRead(var1);
- }
-
- try {
- this.field_0 = new FileDescriptor();
- this.open(var1);
- } catch (IOException var3) {
- throw new FileNotFoundException(var1);
- }
- }
-
- public FileInputStream(File var1) throws FileNotFoundException {
- this(var1.getPath());
- }
-
- public FileInputStream(FileDescriptor var1) {
- SecurityManager var2 = System.getSecurityManager();
- if (var1 == null) {
- throw new NullPointerException();
- } else {
- if (var2 != null) {
- var2.checkRead(var1);
- }
-
- this.field_0 = var1;
- }
- }
-
- private native void open(String var1) throws IOException;
-
- public native int read() throws IOException;
-
- private native int readBytes(byte[] var1, int var2, int var3) throws IOException;
-
- public int read(byte[] var1) throws IOException {
- return this.readBytes(var1, 0, var1.length);
- }
-
- public int read(byte[] var1, int var2, int var3) throws IOException {
- return this.readBytes(var1, var2, var3);
- }
-
- public native long skip(long var1) throws IOException;
-
- public native int available() throws IOException;
-
- public native void close() throws IOException;
-
- public final FileDescriptor getFD() throws IOException {
- if (this.field_0 != null) {
- return this.field_0;
- } else {
- throw new IOException();
- }
- }
-
- protected void finalize() throws IOException {
- if (this.field_0 != null && this.field_0 != FileDescriptor.in) {
- this.close();
- }
-
- }
- }
-