org.apache.commons.io.input
Class ProxyInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by org.apache.commons.io.input.ProxyInputStream
All Implemented Interfaces:
java.io.Closeable
Direct Known Subclasses:
CountingInputStream, SwappedDataInputStream

public abstract class ProxyInputStream
extends java.io.FilterInputStream

A Proxy stream which acts as expected, that is it passes the method calls on to the proxied stream and doesn't change which methods are being called.

It is an alternative base class to FilterInputStream to increase reusability, because FilterInputStream changes the methods being called, such as read(byte[]) to read(byte[], int, int).

Version:
$Id: ProxyInputStream.java 471628 2006-11-06 04:06:45Z bayard $
Author:
Stephen Colebourne

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
ProxyInputStream(java.io.InputStream proxy)
          Constructs a new ProxyInputStream.
 
Method Summary
 int available()
           
 void close()
           
 void mark(int idx)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] bts)
           
 int read(byte[] bts, int st, int end)
           
 void reset()
           
 long skip(long ln)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyInputStream

public ProxyInputStream(java.io.InputStream proxy)
Constructs a new ProxyInputStream.

Parameters:
proxy - the InputStream to delegate to
Method Detail

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException
See Also:
InputStream.read()

read

public int read(byte[] bts)
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException
See Also:
InputStream.read(byte[])

read

public int read(byte[] bts,
                int st,
                int end)
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException
See Also:
InputStream.read(byte[], int, int)

skip

public long skip(long ln)
          throws java.io.IOException
Overrides:
skip in class java.io.FilterInputStream
Throws:
java.io.IOException
See Also:
InputStream.skip(long)

available

public int available()
              throws java.io.IOException
Overrides:
available in class java.io.FilterInputStream
Throws:
java.io.IOException
See Also:
InputStream.available()

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.FilterInputStream
Throws:
java.io.IOException
See Also:
InputStream.close()

mark

public void mark(int idx)
Overrides:
mark in class java.io.FilterInputStream
See Also:
InputStream.mark(int)

reset

public void reset()
           throws java.io.IOException
Overrides:
reset in class java.io.FilterInputStream
Throws:
java.io.IOException
See Also:
InputStream.reset()

markSupported

public boolean markSupported()
Overrides:
markSupported in class java.io.FilterInputStream
See Also:
InputStream.markSupported()


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.