home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / FilterReader.java < prev    next >
Text File  |  1997-05-20  |  3KB  |  121 lines

  1. /*
  2.  * @(#)FilterReader.java    1.5 97/01/27
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. package java.io;
  24.  
  25.  
  26. /**
  27.  * Abstract class for reading filtered character streams.
  28.  *
  29.  * @version     1.5, 97/01/27
  30.  * @author    Mark Reinhold
  31.  * @since    JDK1.1
  32.  */
  33.  
  34. public abstract class FilterReader extends Reader {
  35.  
  36.     /**
  37.      * The underlying character-input stream, or null if the stream has been
  38.      * closed
  39.      */
  40.     protected Reader in;
  41.  
  42.     /**
  43.      * Create a new filtered reader.
  44.      */
  45.     protected FilterReader(Reader in) {
  46.     super(in);
  47.     this.in = in;
  48.     }
  49.  
  50.     /**
  51.      * Read a single character.
  52.      *
  53.      * @exception  IOException  If an I/O error occurs
  54.      */
  55.     public int read() throws IOException {
  56.     return in.read();
  57.     }
  58.  
  59.     /**
  60.      * Read characters into a portion of an array.
  61.      *
  62.      * @exception  IOException  If an I/O error occurs
  63.      */
  64.     public int read(char cbuf[], int off, int len) throws IOException {
  65.     return in.read(cbuf, off, len);
  66.     }
  67.  
  68.     /**
  69.      * Skip characters.
  70.      *
  71.      * @exception  IOException  If an I/O error occurs
  72.      */
  73.     public long skip(long n) throws IOException {
  74.     return in.skip(n);
  75.     }
  76.  
  77.     /**
  78.      * Tell whether this stream is ready to be read.
  79.      *
  80.      * @exception  IOException  If an I/O error occurs
  81.      */
  82.     public boolean ready() throws IOException {
  83.     return in.ready();
  84.     }
  85.  
  86.     /**
  87.      * Tell whether this stream supports the mark() operation.
  88.      */
  89.     public boolean markSupported() {
  90.     return in.markSupported();
  91.     }
  92.  
  93.     /**
  94.      * Mark the present position in the stream.
  95.      *
  96.      * @exception  IOException  If an I/O error occurs
  97.      */
  98.     public void mark(int readAheadLimit) throws IOException {
  99.     in.mark(readAheadLimit);
  100.     }
  101.  
  102.     /**
  103.      * Reset the stream.
  104.      *
  105.      * @exception  IOException  If an I/O error occurs
  106.      */
  107.     public void reset() throws IOException {
  108.     in.reset();
  109.     }
  110.  
  111.     /**
  112.      * Close the stream.
  113.      *
  114.      * @exception  IOException  If an I/O error occurs
  115.      */
  116.     public void close() throws IOException {
  117.     in.close();
  118.     }
  119.  
  120. }
  121.