org.apache.felix.deploymentadmin
Class OutputtingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.felix.deploymentadmin.OutputtingInputStream

public class OutputtingInputStream
extends InputStream

This extension of the InputStream writes every byte that is read to an OutputStream of choice. The outputstream is closed automatically when the end of the inputstream is reached.


Constructor Summary
OutputtingInputStream(InputStream inputStream, OutputStream outputStream)
          Creates an instance of the OutputtingInputStream.
 
Method Summary
 void close()
           
 int read()
           
 int read(byte[] buffer)
           
 int read(byte[] buffer, int off, int len)
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputtingInputStream

public OutputtingInputStream(InputStream inputStream,
                             OutputStream outputStream)
Creates an instance of the OutputtingInputStream.

Parameters:
inputStream - The inputstream from which bytes will be read.
outputStream - The outputstream to which every byte that is read should be outputted.
Method Detail

read

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

read

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

read

public int read(byte[] buffer,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

close

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


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.