home *** CD-ROM | disk | FTP | other *** search
- package java.io;
-
- public class FileOutputStream extends OutputStream {
- // $FF: renamed from: fd java.io.FileDescriptor
- private FileDescriptor field_0;
-
- public FileOutputStream(String var1) throws IOException {
- SecurityManager var2 = System.getSecurityManager();
- if (var2 != null) {
- var2.checkWrite(var1);
- }
-
- try {
- this.field_0 = new FileDescriptor();
- this.open(var1);
- } catch (IOException var3) {
- throw new FileNotFoundException(var1);
- }
- }
-
- public FileOutputStream(String var1, boolean var2) throws IOException {
- SecurityManager var3 = System.getSecurityManager();
- if (var3 != null) {
- var3.checkWrite(var1);
- }
-
- try {
- this.field_0 = new FileDescriptor();
- if (var2) {
- this.openAppend(var1);
- } else {
- this.open(var1);
- }
- } catch (IOException var4) {
- throw new FileNotFoundException(var1);
- }
- }
-
- public FileOutputStream(File var1) throws IOException {
- this(var1.getPath());
- }
-
- public FileOutputStream(FileDescriptor var1) {
- SecurityManager var2 = System.getSecurityManager();
- if (var1 == null) {
- throw new NullPointerException();
- } else {
- if (var2 != null) {
- var2.checkWrite(var1);
- }
-
- this.field_0 = var1;
- }
- }
-
- private native void open(String var1) throws IOException;
-
- private native void openAppend(String var1) throws IOException;
-
- public native void write(int var1) throws IOException;
-
- private native void writeBytes(byte[] var1, int var2, int var3) throws IOException;
-
- public void write(byte[] var1) throws IOException {
- this.writeBytes(var1, 0, var1.length);
- }
-
- public void write(byte[] var1, int var2, int var3) throws IOException {
- this.writeBytes(var1, var2, var3);
- }
-
- 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) {
- if (this.field_0 == FileDescriptor.out || this.field_0 == FileDescriptor.err) {
- ((OutputStream)this).flush();
- return;
- }
-
- this.close();
- }
-
- }
- }
-