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 name) throws IOException {
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- security.checkWrite(name);
- }
-
- try {
- this.field_0 = new FileDescriptor();
- this.open(name);
- } catch (IOException var3) {
- throw new FileNotFoundException(name);
- }
- }
-
- public FileOutputStream(File file) throws IOException {
- this(file.getPath());
- }
-
- public FileOutputStream(FileDescriptor fdObj) {
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- security.checkWrite(fdObj);
- }
-
- this.field_0 = fdObj;
- }
-
- private native void open(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[] b) throws IOException {
- this.writeBytes(b, 0, b.length);
- }
-
- public void write(byte[] b, int off, int len) throws IOException {
- this.writeBytes(b, off, len);
- }
-
- 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.close();
- }
-
- }
- }
-