|
CodeBeamer 5.4.0.1-RC API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
com.intland.codebeamer.utils.AutoClosingInputStream
public class AutoClosingInputStream
Inputstream class that prevents from leaving the stream open: it tries to close the embedded stream immediately when the read operation returns with EOF.
Field Summary |
---|
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
AutoClosingInputStream(java.io.File file,
boolean deleteOnClosed)
|
|
AutoClosingInputStream(java.io.InputStream inputStream)
Read a stream |
Method Summary | |
---|---|
int |
available()
|
void |
close()
|
protected void |
ensureFileOpen()
opens the stream if not open. |
protected void |
finalize()
Overridden to close/drop the file on gc() |
void |
mark(int readlimit)
|
boolean |
markSupported()
|
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int l)
|
void |
reset()
|
void |
setOnDeleteFailed(org.apache.commons.collections.Closure onDeleteFailed)
Set the callback method (Closure) will be called if the deletion of this file has failed. |
long |
skip(long n)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AutoClosingInputStream(java.io.File file, boolean deleteOnClosed) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public AutoClosingInputStream(java.io.InputStream inputStream)
inputStream
- Method Detail |
---|
protected void ensureFileOpen() throws java.io.FileNotFoundException
java.io.FileNotFoundException
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b, int off, int l) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.FilterInputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.FilterInputStream
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.FilterInputStream
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.FilterInputStream
public void mark(int readlimit)
mark
in class java.io.FilterInputStream
public long skip(long n) throws java.io.IOException
skip
in class java.io.FilterInputStream
java.io.IOException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void setOnDeleteFailed(org.apache.commons.collections.Closure onDeleteFailed)
onDeleteFailed
- the onDeleteFailed to set
|
CodeBeamer 5.4.0.1-RC API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |