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/FilterInputStream.java | 340 ++++++++++++++++----------------- 1 file changed, 166 insertions(+), 174 deletions(-) (limited to 'libjava/java/io/FilterInputStream.java') diff --git a/libjava/java/io/FilterInputStream.java b/libjava/java/io/FilterInputStream.java index 7176b596423..80cbd927375 100644 --- a/libjava/java/io/FilterInputStream.java +++ b/libjava/java/io/FilterInputStream.java @@ -70,179 +70,171 @@ package java.io; public class FilterInputStream extends InputStream { -/*************************************************************************/ - -/* - * Instance Variables - */ - -/** - * This is the subordinate InputStream to which method calls - * are redirected - */ -protected InputStream in; - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * Create a FilterInputStream with the specified subordinate - * InputStream. - * - * @param in The subordinate InputStream - */ -protected -FilterInputStream(InputStream in) -{ - this.in = in; -} - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * Calls the in.mark(int) method. - * - * @param readlimit The parameter passed to in.mark(int) - */ -public void -mark(int readlimit) -{ - in.mark(readlimit); -} - -/*************************************************************************/ - -/** - * Calls the in.markSupported() method. - * - * @return true if mark/reset is supported, false - * otherwise - */ -public boolean -markSupported() -{ - return(in.markSupported()); -} - -/*************************************************************************/ - -/** - * Calls the in.reset() method. - * - * @exception IOException If an error occurs - */ -public void -reset() throws IOException -{ - in.reset(); -} - -/*************************************************************************/ - -/** - * Calls the in.available() method. - * - * @return The value returned from in.available() - * - * @exception IOException If an error occurs - */ -public int -available() throws IOException -{ - return(in.available()); -} - -/*************************************************************************/ - -/** - * Calls the in.skip(long) method - * - * @param The requested number of bytes to skip. - * - * @return The value returned from in.skip(long) - * - * @exception IOException If an error occurs - */ -public long -skip(long num_bytes) throws IOException -{ - return(in.skip(num_bytes)); -} - -/*************************************************************************/ - -/** - * Calls the in.read() method - * - * @return The value returned from in.read() - * - * @exception IOException If an error occurs - */ -public int -read() throws IOException -{ - return(in.read()); -} - -/*************************************************************************/ - -/** - * Calls the read(byte[], int, int) overloaded method. Note that - * this method does not redirect its call directly to a corresponding - * method in in. This allows subclasses to override only the - * three argument version of read. - * - * @param buf The buffer to read bytes into - * - * @return The value retured from in.read(byte[], int, int) - * - * @exception IOException If an error occurs - */ -public int -read(byte[] buf) throws IOException -{ - return(read(buf, 0, buf.length)); -} - -/*************************************************************************/ - -/** - * Calls the in.read(byte[], int, int) method. - * - * @param buf The buffer to read bytes into - * @param offset The index into the buffer to start storing bytes - * @param len The maximum number of bytes to read. - * - * @return The value retured from in.read(byte[], int, int) - * - * @exception IOException If an error occurs - */ -public int -read(byte[] buf, int offset, int len) throws IOException -{ - return(in.read(buf, offset, len)); -} - -/*************************************************************************/ - -/** - * This method closes the input stream by closing the input stream that - * this object is filtering. Future attempts to access this stream may - * throw an exception. - * - * @exception IOException If an error occurs - */ -public void -close() throws IOException -{ - in.close(); -} + /*************************************************************************/ + + /* + * Instance Variables + */ + + /** + * This is the subordinate InputStream to which method calls + * are redirected + */ + protected InputStream in; + + /*************************************************************************/ + + /* + * Constructors + */ + + /** + * Create a FilterInputStream with the specified subordinate + * InputStream. + * + * @param in The subordinate InputStream + */ + protected FilterInputStream(InputStream in) + { + this.in = in; + } + + /*************************************************************************/ + + /* + * Instance Methods + */ + + /** + * Calls the in.mark(int) method. + * + * @param readlimit The parameter passed to in.mark(int) + */ + public void mark(int readlimit) + { + in.mark(readlimit); + } + + /*************************************************************************/ + + /** + * Calls the in.markSupported() method. + * + * @return true if mark/reset is supported, false + * otherwise + */ + public boolean markSupported() + { + return(in.markSupported()); + } + + /*************************************************************************/ + + /** + * Calls the in.reset() method. + * + * @exception IOException If an error occurs + */ + public void reset() throws IOException + { + in.reset(); + } + + /*************************************************************************/ + + /** + * Calls the in.available() method. + * + * @return The value returned from in.available() + * + * @exception IOException If an error occurs + */ + public int available() throws IOException + { + return(in.available()); + } + + /*************************************************************************/ + + /** + * Calls the in.skip(long) method + * + * @param numBytes The requested number of bytes to skip. + * + * @return The value returned from in.skip(long) + * + * @exception IOException If an error occurs + */ + public long skip(long num_bytes) throws IOException + { + return(in.skip(num_bytes)); + } + + /*************************************************************************/ + + /** + * Calls the in.read() method + * + * @return The value returned from in.read() + * + * @exception IOException If an error occurs + */ + public int read() throws IOException + { + return(in.read()); + } + + /*************************************************************************/ + + /** + * Calls the read(byte[], int, int) overloaded method. + * Note that + * this method does not redirect its call directly to a corresponding + * method in in. This allows subclasses to override only the + * three argument version of read. + * + * @param buf The buffer to read bytes into + * + * @return The value retured from in.read(byte[], int, int) + * + * @exception IOException If an error occurs + */ + public int read(byte[] buf) throws IOException + { + return(read(buf, 0, buf.length)); + } + + /*************************************************************************/ + + /** + * Calls the in.read(byte[], int, int) method. + * + * @param buf The buffer to read bytes into + * @param offset The index into the buffer to start storing bytes + * @param len The maximum number of bytes to read. + * + * @return The value retured from in.read(byte[], int, int) + * + * @exception IOException If an error occurs + */ + public int read(byte[] buf, int offset, int len) throws IOException + { + return(in.read(buf, offset, len)); + } + + /*************************************************************************/ + + /** + * This method closes the input stream by closing the input stream that + * this object is filtering. Future attempts to access this stream may + * throw an exception. + * + * @exception IOException If an error occurs + */ + public void close() throws IOException + { + in.close(); + } } // class FilterInputStream + -- cgit v1.2.3