diff options
| author | Michael Koch <konqueror@gmx.de> | 2003-03-18 06:00:25 +0000 |
|---|---|---|
| committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-03-18 06:00:25 +0000 |
| commit | f4f5d1d62161cc99ecfc68495d501342aa1e61dc (patch) | |
| tree | 9f83602fa5fd87c7741475487fab1b0b3a3e47ab /libjava/java/io/FilterInputStream.java | |
| parent | 61f1ed592c606d1d2ae272292ad4dbe37d71d78b (diff) | |
BufferedReader.java, [...]: Merged from classpath.
2003-03-18 Michael Koch <konqueror@gmx.de>
* 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
Diffstat (limited to 'libjava/java/io/FilterInputStream.java')
| -rw-r--r-- | libjava/java/io/FilterInputStream.java | 340 |
1 files changed, 166 insertions, 174 deletions
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 <code>InputStream</code> to which method calls - * are redirected - */ -protected InputStream in; - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * Create a <code>FilterInputStream</code> with the specified subordinate - * <code>InputStream</code>. - * - * @param in The subordinate <code>InputStream</code> - */ -protected -FilterInputStream(InputStream in) -{ - this.in = in; -} - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * Calls the <code>in.mark(int)</code> method. - * - * @param readlimit The parameter passed to <code>in.mark(int)</code> - */ -public void -mark(int readlimit) -{ - in.mark(readlimit); -} - -/*************************************************************************/ - -/** - * Calls the <code>in.markSupported()</code> method. - * - * @return <code>true</code> if mark/reset is supported, <code>false</code> - * otherwise - */ -public boolean -markSupported() -{ - return(in.markSupported()); -} - -/*************************************************************************/ - -/** - * Calls the <code>in.reset()</code> method. - * - * @exception IOException If an error occurs - */ -public void -reset() throws IOException -{ - in.reset(); -} - -/*************************************************************************/ - -/** - * Calls the <code>in.available()</code> method. - * - * @return The value returned from <code>in.available()</code> - * - * @exception IOException If an error occurs - */ -public int -available() throws IOException -{ - return(in.available()); -} - -/*************************************************************************/ - -/** - * Calls the <code>in.skip(long)</code> method - * - * @param The requested number of bytes to skip. - * - * @return The value returned from <code>in.skip(long)</code> - * - * @exception IOException If an error occurs - */ -public long -skip(long num_bytes) throws IOException -{ - return(in.skip(num_bytes)); -} - -/*************************************************************************/ - -/** - * Calls the <code>in.read()</code> method - * - * @return The value returned from <code>in.read()</code> - * - * @exception IOException If an error occurs - */ -public int -read() throws IOException -{ - return(in.read()); -} - -/*************************************************************************/ - -/** - * Calls the <code>read(byte[], int, int)</code> overloaded method. Note that - * this method does not redirect its call directly to a corresponding - * method in <code>in</code>. This allows subclasses to override only the - * three argument version of <code>read</code>. - * - * @param buf The buffer to read bytes into - * - * @return The value retured from <code>in.read(byte[], int, int)</code> - * - * @exception IOException If an error occurs - */ -public int -read(byte[] buf) throws IOException -{ - return(read(buf, 0, buf.length)); -} - -/*************************************************************************/ - -/** - * Calls the <code>in.read(byte[], int, int)</code> 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 <code>in.read(byte[], int, int)</code> - * - * @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 <code>InputStream</code> to which method calls + * are redirected + */ + protected InputStream in; + + /*************************************************************************/ + + /* + * Constructors + */ + + /** + * Create a <code>FilterInputStream</code> with the specified subordinate + * <code>InputStream</code>. + * + * @param in The subordinate <code>InputStream</code> + */ + protected FilterInputStream(InputStream in) + { + this.in = in; + } + + /*************************************************************************/ + + /* + * Instance Methods + */ + + /** + * Calls the <code>in.mark(int)</code> method. + * + * @param readlimit The parameter passed to <code>in.mark(int)</code> + */ + public void mark(int readlimit) + { + in.mark(readlimit); + } + + /*************************************************************************/ + + /** + * Calls the <code>in.markSupported()</code> method. + * + * @return <code>true</code> if mark/reset is supported, <code>false</code> + * otherwise + */ + public boolean markSupported() + { + return(in.markSupported()); + } + + /*************************************************************************/ + + /** + * Calls the <code>in.reset()</code> method. + * + * @exception IOException If an error occurs + */ + public void reset() throws IOException + { + in.reset(); + } + + /*************************************************************************/ + + /** + * Calls the <code>in.available()</code> method. + * + * @return The value returned from <code>in.available()</code> + * + * @exception IOException If an error occurs + */ + public int available() throws IOException + { + return(in.available()); + } + + /*************************************************************************/ + + /** + * Calls the <code>in.skip(long)</code> method + * + * @param numBytes The requested number of bytes to skip. + * + * @return The value returned from <code>in.skip(long)</code> + * + * @exception IOException If an error occurs + */ + public long skip(long num_bytes) throws IOException + { + return(in.skip(num_bytes)); + } + + /*************************************************************************/ + + /** + * Calls the <code>in.read()</code> method + * + * @return The value returned from <code>in.read()</code> + * + * @exception IOException If an error occurs + */ + public int read() throws IOException + { + return(in.read()); + } + + /*************************************************************************/ + + /** + * Calls the <code>read(byte[], int, int)</code> overloaded method. + * Note that + * this method does not redirect its call directly to a corresponding + * method in <code>in</code>. This allows subclasses to override only the + * three argument version of <code>read</code>. + * + * @param buf The buffer to read bytes into + * + * @return The value retured from <code>in.read(byte[], int, int)</code> + * + * @exception IOException If an error occurs + */ + public int read(byte[] buf) throws IOException + { + return(read(buf, 0, buf.length)); + } + + /*************************************************************************/ + + /** + * Calls the <code>in.read(byte[], int, int)</code> 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 <code>in.read(byte[], int, int)</code> + * + * @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 + |
