Package org.greenrobot.essentials.io
Class RepeaterInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.greenrobot.essentials.io.RepeaterInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class RepeaterInputStream extends java.io.FilterInputStream
Repeats an input stream to an additional OutputStream. The data of the InputStream becomes available for two purposes, e.g. reading data and storing for caching. Note: OutputStream is not closed when close() is called.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.OutputStream
out
-
Constructor Summary
Constructors Constructor Description RepeaterInputStream(java.io.InputStream in, java.io.OutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
void
reset()
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classjava.io.FilterInputStream
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classjava.io.FilterInputStream
-
reset
public void reset() throws java.io.IOException
- Overrides:
reset
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
-