com.gc.iotools.stream.base
Class AbstractInputStreamWrapper
java.lang.Object
java.io.InputStream
com.gc.iotools.stream.base.AbstractInputStreamWrapper
- All Implemented Interfaces:
- Closeable
- Direct Known Subclasses:
- RandomAccessInputStream, TeeInputStreamOutputStream
public abstract class AbstractInputStreamWrapper
- extends InputStream
Provides common functionality to the easystream library:
- holds a source InputStream
- provide a closeOnce() method that's called exactly once.
- provide an implementation of #skip() and
read() methods.
- Keeps track of the position in the source stream over mark and reset.
- Since:
- 1.2.0
- Author:
- dvd.smnt
|
Method Summary |
void |
close()
|
protected abstract void |
closeOnce()
|
protected abstract int |
innerRead(byte[] b,
int off,
int len)
|
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
long |
skip(long n)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
source
protected final InputStream source
closeCalled
protected boolean closeCalled
AbstractInputStreamWrapper
protected AbstractInputStreamWrapper(InputStream source)
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Overrides:
close in class InputStream
- Throws:
IOException
innerRead
protected abstract int innerRead(byte[] b,
int off,
int len)
throws IOException
- Throws:
IOException
read
public int read()
throws IOException
- Specified by:
read in class InputStream
- Throws:
IOException
read
public final int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read in class InputStream
- Throws:
IOException
skip
public long skip(long n)
throws IOException
- Overrides:
skip in class InputStream
- Throws:
IOException
closeOnce
protected abstract void closeOnce()
throws IOException
- Throws:
IOException
Copyright © 2008-2009. All Rights Reserved.