com.gc.iotools.stream.base
Class AbstractInputStreamWrapper

java.lang.Object
  extended by java.io.InputStream
      extended by 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:

Since:
1.2.0
Author:
dvd.smnt

Field Summary
protected  boolean closeCalled
           
protected  InputStream source
           
 
Constructor Summary
protected AbstractInputStreamWrapper(InputStream source)
           
 
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.io.InputStream
available, mark, markSupported, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected final InputStream source

closeCalled

protected boolean closeCalled
Constructor Detail

AbstractInputStreamWrapper

protected AbstractInputStreamWrapper(InputStream source)
Method Detail

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.