TrueZIP Kernel 7.0-rc2

de.schlichtherle.truezip.io
Class DecoratingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by de.schlichtherle.truezip.io.DecoratingInputStream
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
ConcurrentInputShop.ConcurrentInputStream, FsStatistics.CountingInputStream, IOCache.Buffer.BufferInputStream, LazyInputSocket.ProxyInputStream, SynchronizedInputStream

@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class)
public abstract class DecoratingInputStream
extends InputStream

An abstract decorator for an input stream. This is a clean room implementation of its cousin FilterInputStream in the JSE, but optimized for performance and without multithreading support.

Author:
Christian Schlichtherle
See Also:
DecoratingOutputStream

Field Summary
protected  InputStream delegate
          The nullable decorated input stream.
 
Constructor Summary
protected DecoratingInputStream(InputStream in)
          Constructs a new filter input stream.
 
Method Summary
 int available()
           
 void close()
           
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 long skip(long n)
           
 String toString()
          Returns a string representation of this object for debugging and logging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

delegate

@Nullable
protected InputStream delegate
The nullable decorated input stream.

Constructor Detail

DecoratingInputStream

protected DecoratingInputStream(@CheckForNull
                                InputStream in)
Constructs a new filter input stream.

Parameters:
in - the input stream to wrap in this decorator.
Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public final int read(byte[] b)
               throws IOException
Overrides:
read in class InputStream
Throws:
IOException

read

public 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

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException

mark

public void mark(int readlimit)
Overrides:
mark in class InputStream

reset

public void reset()
           throws IOException
Overrides:
reset in class InputStream
Throws:
IOException

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream

toString

public String toString()
Returns a string representation of this object for debugging and logging purposes.

Overrides:
toString in class Object

TrueZIP Kernel 7.0-rc2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.