de.cau.cs.kieler.core.util
Class ForwardingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by de.cau.cs.kieler.core.util.ForwardingInputStream
All Implemented Interfaces:
Closeable

public class ForwardingInputStream
extends InputStream

An input stream that forwards all read data to an output stream.

Rating proposed yellow
(2009-12-11) msp

Constructor Summary
ForwardingInputStream(InputStream theinputStream, OutputStream theoutputStream)
          Creates a forwarding input stream with the given input and output streams.
 
Method Summary
 int available()
          
 void close()
          Closes this input stream and releases any system resources associated with the stream.
 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)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForwardingInputStream

public ForwardingInputStream(InputStream theinputStream,
                             OutputStream theoutputStream)
Creates a forwarding input stream with the given input and output streams.

Parameters:
theinputStream - the input stream from which data is read
theoutputStream - the output stream to which data is written
Method Detail

read

public int read()
         throws IOException

Specified by:
read in class InputStream
Throws:
IOException

read

public 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
Closes this input stream and releases any system resources associated with the stream. This method does not close the output stream.

Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException - if an I/O error occurs.

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