Package org.takes.rq
Class TempInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.takes.rq.TempInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public final class TempInputStream extends InputStream
Input stream wrapper that removes associated File instance on close.- Since:
- 0.31
-
-
Constructor Summary
Constructors Constructor Description TempInputStream(InputStream stream, File temp)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
int
read()
int
read(byte[] buf)
int
read(byte[] buf, int off, int len)
long
skip(long num)
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, transferTo
-
-
-
-
Constructor Detail
-
TempInputStream
public TempInputStream(InputStream stream, File temp)
Ctor.- Parameters:
stream
- Original streamtemp
- File instance
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] buf) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] buf, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
public long skip(long num) throws IOException
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
public int available() throws IOException
- Overrides:
available
in classInputStream
- Throws:
IOException
-
-