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:
- java.io.Closeable
public class TeeInputStream
- extends java.io.FilterInputStream
FilterInputStream implementation that sends a copy of all data being processed to the specified OutputStream.
- Since:
- 3.2
- Author:
- Gert Vanthienen (gertv)
| Fields inherited from class java.io.FilterInputStream |
in |
|
Constructor Summary |
TeeInputStream(java.io.InputStream is,
java.io.OutputStream os)
Create a new TeeInputStream |
|
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.io.FilterInputStream |
available, mark, markSupported, read, reset, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TeeInputStream
public TeeInputStream(java.io.InputStream is,
java.io.OutputStream os)
- Create a new TeeInputStream
- Parameters:
is - the InputStream to read fromos - the OuputStream to copy data to
read
public int read()
throws java.io.IOException
- Reads a single byte from the underlying InputStream. In addition, it also write the same byte to the OutputStream.
- Overrides:
read in class java.io.FilterInputStream
- Throws:
java.io.IOException
read
public int read(byte[] bytes,
int offset,
int length)
throws java.io.IOException
- Read a block of bytes from the underlying InputStream. In addition, write the same data to the OutputStream.
- Overrides:
read in class java.io.FilterInputStream
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Close the underlying InputStream. Also, flush and close the underlying OutputStream.
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class java.io.FilterInputStream
- Throws:
java.io.IOException
Copyright © 2005-2012 FuseSource. All Rights Reserved.