org.apache.servicemix.jbi.audit.file
Class TeeInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.servicemix.jbi.audit.file.TeeInputStream
- All Implemented Interfaces:
- Closeable
public class TeeInputStream
- extends FilterInputStream
FilterInputStream implementation that sends a copy of all data being processed to the specified OutputStream.
- Since:
- 3.2
- Author:
- Gert Vanthienen (gertv)
|
Method Summary |
void |
close()
Close the underlying InputStream. |
int |
read()
Reads a single byte from the underlying InputStream. |
int |
read(byte[] bytes,
int offset,
int length)
Read a block of bytes from the underlying InputStream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TeeInputStream
public TeeInputStream(InputStream is,
OutputStream os)
- Create a new TeeInputStream
- Parameters:
is - the InputStream to read fromos - the OuputStream to copy data to
read
public int read()
throws IOException
- Reads a single byte from the underlying InputStream. In addition, it also write the same byte to the OutputStream.
- Overrides:
read in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] bytes,
int offset,
int length)
throws IOException
- Read a block of bytes from the underlying InputStream. In addition, write the same data to the OutputStream.
- Overrides:
read in class FilterInputStream
- Throws:
IOException
close
public void close()
throws IOException
- Close the underlying InputStream. Also, flush and close the underlying OutputStream.
- Specified by:
close in interface Closeable- Overrides:
close in class FilterInputStream
- Throws:
IOException
Copyright © 2005-2008 The Apache Software Foundation. All Rights Reserved.