Logo
Distributed Genetic Programming Framework
print print

File org.sfc.io.DefaultReader.java

Here you can find all the information about the file org.sfc.io.DefaultReader.java. You may explore it here or download it onto your local disk.
/*
 * Copyright (c) 2005 Thomas Weise
 * 
 * E-Mail           : tweise@gmx.de
 * Creation Date    : 2005-06-22 16:25:35
 * Original Filename: org.sfc.io.DefaultReader.java
 * Version          : 1.0.2
 * Last modification: 2006-03-07
 *                by: Thomas Weise
 * 
 * License          : GNU LESSER GENERAL PUBLIC LICENSE
 *                    Version 2.1, February 1999
 *                    You should have received a copy of this license along
 *                    with this library; if not, write to the Free Software
 *                    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *                    MA 02111-1307, USA or download the license under
 *                    http://www.gnu.org/copyleft/lesser.html.
 *                    
 * Warranty         : This software is provided "as is" without any
 *                    warranty; without even the implied warranty of
 *                    merchantability or fitness for a particular purpose.
 *                    See the Gnu Lesser General Public License for more
 *                    details.
 */

 
package org.sfc.io;

import java.io.IOException;
import java.io.Reader;

/**
 * This class is a wrapper for <code>Reader</code>s that makes them
 * reference counted.
 * @author Thomas Weise 
 */

final  class DefaultReader  extends   ReferenceCountedReader
  { 
/**
 * The internal reader.
 */

  private final Reader  m_in;
    
/**
 * Create a reference counted <code>Reader</code>.
 * 
 * @param p_original  The underlying object.
 */

  DefaultReader  (final  Reader p_original)
    {
    super();
    this.m_in = p_original;
    this.lock = p_original;
    }
    
  
/**
 * Dispose this reader.
 * @throws  IOException If the underlying was closed and caused an
 *                      IOException.
 */

  @Override
  protected final void  dispose() throws IOException
    {
    try
      {
      this.m_in.close();
      }
    finally
      {
      super.dispose();
      }
    }
  
/**
 * Read a single character.
 * @return  The character.
 * @exception  IOException  If an I/O error occurs
 */

  @Override
  public final  int read() throws IOException
    {
    return this.m_in.read();
    }

/**
 * Read characters into a portion of an array.
 * @param p_cbuf  The buffer to fill with data.
 * @param p_off   The offset into the buffer where to begin to write.
 * @param p_len   The count of characters to read.
 * @return  The count of characters actually read.
 * @exception  IOException  If an I/O error occurs
 */

  @Override
  public final  int read(final  char[]  p_cbuf,
                         final  int     p_off,
                         final  int     p_len) throws IOException
    {
    return this.m_in.read(p_cbuf, p_off, p_len);
    }

/**
 * Skip characters.
 * @param p_n The count of characters to skip.
 * @return  The count of characters actually skipped.
 * @exception  IOException  If an I/O error occurs
 */

  @Override
  public final  long skip(final long p_n) throws IOException
    {
    return this.m_in.skip(p_n);
    }

/**
 * Tell whether this stream is ready to be read.
 * @return <code>true</code> if this stream is ready to be read.
 * @exception  IOException  If an I/O error occurs
 */

  @Override  
  public final  boolean ready() throws IOException
    {
    return this.m_in.ready();
    }

/**
 * Tell whether this stream supports the mark() operation.
 * @return  <code>true</code> if marking is supported by the underlying
 *          stream.
 */

  @Override
  public final  boolean markSupported()
    {
    return this.m_in.markSupported();
    }

/**
 * Mark the present position in the stream.
 * @param p_read_ahead_limit The read ahead limit.
 * @exception  IOException  If an I/O error occurs
 */

  @Override
  public final  void mark(final int p_read_ahead_limit) throws IOException
    {
    this.m_in.mark(p_read_ahead_limit);
    }

/**
 * Reset the stream.
 * @exception  IOException  If an I/O error occurs
 */

  @Override
  public final  void reset() throws IOException
    {
    this.m_in.reset();
    }
  }

File Information:

file name:DefaultReader.java
package:org.sfc.io
qualified name:org.sfc.io.DefaultReader.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/sfc/io/DefaultReader.java
size:4.115 KB (4214 B)
uploaded: 2015-07-22 04:11:12 GMT+0000
last update: 2006-03-07 04:20:28 GMT+0000
last access: 2018-01-22 04:06:55 GMT+0000

statistics online since 2006-01-02.   RSS Feed
Contact us by sending an email to tweise@gmx.de to receive further information, to report errors, or to join our project.
All content on this site (http://dgpf.sourceforge.net/) is LGPL-licensed.
http://dgpf.sourceforge.net/scripts/source/source.php last modified at 2015-07-22 04:10:53 GMT+0000 served at 2018-01-22 04:06:55 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo