source: trunk/gcc/libjava/java/io/FileOutputStream.java@ 3951

Last change on this file since 3951 was 1392, checked in by bird, 22 years ago

This commit was generated by cvs2svn to compensate for changes in r1391,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 2.3 KB
Line 
1// FileOutputStream.java - Write bytes to a file.
2
3/* Copyright (C) 1998, 1999, 2001 Free Software Foundation
4
5 This file is part of libgcj.
6
7This software is copyrighted work licensed under the terms of the
8Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
9details. */
10
11package java.io;
12
13import java.nio.channels.FileChannel;
14
15/**
16 * @author Tom Tromey <[email protected]>
17 * @date September 24, 1998
18 */
19
20/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
21 * "The Java Language Specification", ISBN 0-201-63451-1
22 * Status: Complete to version 1.1.
23 */
24
25public class FileOutputStream extends OutputStream
26{
27 public FileOutputStream (String path, boolean append)
28 throws SecurityException, FileNotFoundException
29 {
30 SecurityManager s = System.getSecurityManager();
31 if (s != null)
32 s.checkWrite(path);
33 fd = new FileDescriptor (path, (append
34 ? FileDescriptor.APPEND
35 : FileDescriptor.WRITE));
36 }
37
38 public FileOutputStream (String path)
39 throws SecurityException, FileNotFoundException
40 {
41 this (path, false);
42 }
43
44 public FileOutputStream (File file)
45 throws SecurityException, FileNotFoundException
46 {
47 this (file.getPath(), false);
48 }
49
50 public FileOutputStream (FileDescriptor fdObj)
51 throws SecurityException
52 {
53 SecurityManager s = System.getSecurityManager();
54 if (s != null)
55 s.checkWrite(fdObj);
56 fd = fdObj;