From f4f5d1d62161cc99ecfc68495d501342aa1e61dc Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Tue, 18 Mar 2003 06:00:25 +0000 Subject: BufferedReader.java, [...]: Merged from classpath. 2003-03-18 Michael Koch * java/io/BufferedReader.java, java/io/BufferedWriter.java, java/io/ByteArrayOutputStream.java, java/io/FileFilter.java, java/io/FilePermission.java, java/io/FileReader.java, java/io/FileWriter.java, java/io/FilenameFilter.java, java/io/FilterInputStream.java, java/io/FilterOutputStream.java, java/io/FilterReader.java, java/io/FilterWriter.java, java/io/ObjectInput.java, java/io/ObjectInputValidation.java, java/io/ObjectOutput.java, java/io/ObjectStreamField.java, java/io/PipedInputStream.java, java/io/PipedReader.java, java/io/PrintWriter.java, java/io/PushbackReader.java, java/io/Reader.java, java/io/SerializablePermission.java, java/io/StringReader.java, java/io/Writer.java: Merged from classpath. From-SVN: r64525 --- libjava/java/io/FilterWriter.java | 232 ++++++++++++++++++-------------------- 1 file changed, 112 insertions(+), 120 deletions(-) (limited to 'libjava/java/io/FilterWriter.java') diff --git a/libjava/java/io/FilterWriter.java b/libjava/java/io/FilterWriter.java index f94d9955a3d..f476dfee3f5 100644 --- a/libjava/java/io/FilterWriter.java +++ b/libjava/java/io/FilterWriter.java @@ -1,5 +1,5 @@ /* FilterWriter.java -- Parent class for output streams that filter - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -52,128 +52,120 @@ package java.io; * underlying stream. Subclasses provide actual filtering. * * @author Aaron M. Renn (arenn@urbanophile.com) - * @author Tom Tromey + * @author Tom Tromey */ public abstract class FilterWriter extends Writer { - -/*************************************************************************/ - -/* - * Instance Variables - */ - -/** - * This is the subordinate Writer that this class - * redirects its method calls to. - */ -protected Writer out; - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * This method initializes an instance of FilterWriter - * to write to the specified subordinate Writer. - * The given Writer will be used as lock for - * the newly created FilterWriter. - * - * @param out The Writer to write to - */ -protected -FilterWriter(Writer out) -{ - super(out); - this.out = out; -} - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * This method closes the underlying Writer. Any - * further attempts to write to this stream may throw an exception. - * - * @exception IOException If an error occurs - */ -public void -close() throws IOException -{ - out.close(); -} - -/*************************************************************************/ - -/** - * This method attempt to flush all buffered output to be written to the - * underlying output sink. - * - * @exception IOException If an error occurs - */ -public void -flush() throws IOException -{ - out.flush(); -} - -/*************************************************************************/ - -/** - * This method writes a single char of output to the underlying - * Writer. - * - * @param b The char to write, passed as an int. - * - * @exception IOException If an error occurs - */ -public void -write(int b) throws IOException -{ - out.write(b); -} - -/*************************************************************************/ - -/** - * This method writes len chars from the array buf - * starting at index offset to the underlying - * Writer. - * - * @param buf The char array to write chars from - * @param offset The index into the array to start writing chars from - * @param len The number of chars to write - * - * @exception IOException If an error occurs - */ -public void -write(char[] buf, int offset, int len) throws IOException -{ - out.write(buf, offset, len); -} - -/*************************************************************************/ - -/** - * This method writes len chars from the String - * starting at position offset. - * - * @param str The String that is to be written - * @param offset The character offset into the String to start writing from - * @param len The number of chars to write - * - * @exception IOException If an error occurs - */ -public void -write(String str, int offset, int len) throws IOException -{ - out.write(str, offset, len); -} + /* + * Instance Variables + */ + + /** + * This is the subordinate Writer that this class + * redirects its method calls to. + */ + protected Writer out; + + /*************************************************************************/ + + /* + * Constructors + */ + + /** + * This method initializes an instance of FilterWriter + * to write to the specified subordinate Writer. + * The given Writer will be used as lock for + * the newly created FilterWriter. + * + * @param out The Writer to write to + */ + protected FilterWriter(Writer out) + { + super(out); + this.out = out; + } + + /*************************************************************************/ + + /* + * Instance Methods + */ + + /** + * This method closes the underlying Writer. Any + * further attempts to write to this stream may throw an exception. + * + * @exception IOException If an error occurs + */ + public void close() throws IOException + { + out.close(); + } + + /*************************************************************************/ + + /** + * This method attempt to flush all buffered output to be written to the + * underlying output sink. + * + * @exception IOException If an error occurs + */ + public void flush() throws IOException + { + out.flush(); + } + + /*************************************************************************/ + + /** + * This method writes a single char of output to the underlying + * Writer. + * + * @param b The char to write, passed as an int. + * + * @exception IOException If an error occurs + */ + public void write(int b) throws IOException + { + out.write(b); + } + + /*************************************************************************/ + + /** + * This method writes len chars from the array buf + * starting at index offset to the underlying + * Writer. + * + * @param buf The char array to write chars from + * @param offset The index into the array to start writing chars from + * @param len The number of chars to write + * + * @exception IOException If an error occurs + */ + public void write(char[] buf, int offset, int len) throws IOException + { + out.write(buf, offset, len); + } + + /*************************************************************************/ + + /** + * This method writes len chars from the String + * starting at position offset. + * + * @param str The String that is to be written + * @param offset The character offset into the String + * to start writing from + * @param len The number of chars to write + * + * @exception IOException If an error occurs + */ + public void write(String str, int offset, int len) throws IOException + { + out.write(str, offset, len); + } } // class FilterWriter -- cgit v1.2.3