001 /**
002 * ===========================================================
003 * LibRepository : a free Java content repository access layer
004 * ===========================================================
005 *
006 * Project Info: http://jfreereport.pentaho.org/librepository/
007 *
008 * (C) Copyright 2006, by Pentaho Corporation and Contributors.
009 *
010 * This library is free software; you can redistribute it and/or modify it under the terms
011 * of the GNU Lesser General Public License as published by the Free Software Foundation;
012 * either version 2.1 of the License, or (at your option) any later version.
013 *
014 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
015 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016 * See the GNU Lesser General Public License for more details.
017 *
018 * You should have received a copy of the GNU Lesser General Public License along with this
019 * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
020 * Boston, MA 02111-1307, USA.
021 *
022 * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
023 * in the United States and other countries.]
024 *
025 * ------------
026 * WrappedInputStream.java
027 * ------------
028 * (C) Copyright 2006, by Pentaho Corporation.
029 */
030
031 package org.jfree.repository.stream;
032
033 import java.io.IOException;
034 import java.io.InputStream;
035
036 /**
037 * Creation-Date: 13.11.2006, 17:28:24
038 *
039 * @author Thomas Morgner
040 */
041 public class WrappedInputStream extends InputStream
042 {
043 private boolean closed;
044 private InputStream parent;
045
046 public WrappedInputStream(final InputStream parent)
047 {
048 this.parent = parent;
049 }
050
051 public int read()
052 throws IOException
053 {
054 return parent.read();
055 }
056
057 public int read(final byte[] b)
058 throws IOException
059 {
060 return parent.read(b);
061 }
062
063 public int read(final byte[] b, final int off, final int len)
064 throws IOException
065 {
066 return parent.read(b, off, len);
067 }
068
069 public long skip(final long n)
070 throws IOException
071 {
072 return parent.skip(n);
073 }
074
075 public int available()
076 throws IOException
077 {
078 return parent.available();
079 }
080
081 public void close()
082 throws IOException
083 {
084 closed = true;
085 parent.close();
086 }
087
088 public boolean isClosed()
089 {
090 return closed;
091 }
092
093 public void mark(final int readlimit)
094 {
095 parent.mark(readlimit);
096 }
097
098 public void reset()
099 throws IOException
100 {
101 parent.reset();
102 }
103
104 public boolean markSupported()
105 {
106 return parent.markSupported();
107 }
108 }