OSDN Git Service

* All files: Updated copyright information.
[pf3gnuchains/gcc-fork.git] / libjava / java / io / FilterOutputStream.java
1 // FilterOutputStream.java - A filtered stream
2
3 /* Copyright (C) 1998, 1999  Free Software Foundation
4
5    This file is part of libgcj.
6
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
9 details.  */
10
11 package java.io;
12
13 /**
14  * @author Tom Tromey <tromey@cygnus.com>
15  * @date September 24, 1998 
16  */
17
18 /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
19  * "The Java Language Specification", ISBN 0-201-63451-1
20  * Status:  Complete to version 1.1.
21  */
22
23 public class FilterOutputStream extends OutputStream
24 {
25   public void close () throws IOException
26   {
27     flush ();
28     out.close();
29   }
30
31   public FilterOutputStream (OutputStream ox)
32   {
33     out = ox;
34   }
35
36   public void flush () throws IOException
37   {
38     out.flush();
39   }
40
41   public void write (int b) throws IOException
42   {
43     out.write(b);
44   }
45
46   public void write (byte[] b) throws IOException, NullPointerException
47   {
48     // Don't do checking here, per Java Lang Spec.
49     write (b, 0, b.length);
50   }
51
52   public void write (byte[] b, int off, int len)
53     throws IOException, NullPointerException, IndexOutOfBoundsException
54   {
55     // Don't do checking here, per Java Lang Spec.
56     for (int i=0; i < len; i++) 
57       write (b[off + i]);
58   }
59
60   // The output stream.
61   protected OutputStream out;
62 }