net.sf.basedb.ws.server
Class TempFileDataSource.TempInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
net.sf.basedb.ws.server.TempFileDataSource.TempInputStream
- All Implemented Interfaces:
- Closeable
- Enclosing class:
- TempFileDataSource
private class TempFileDataSource.TempInputStream
- extends FilterInputStream
An InputStream implementation that deletes the source file
once the entire stream has been read (=any of the read()
methods return -1) or when close() is called.
Method Summary |
void |
close()
|
private void |
deleteTempFile()
Delete the temp file if it exists and we know that
only one stream is reading from it. |
protected void |
finalize()
|
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
file
private File file
TempFileDataSource.TempInputStream
private TempFileDataSource.TempInputStream(InputStream in,
File file)
read
public int read()
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] b)
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class FilterInputStream
- Throws:
IOException
finalize
protected void finalize()
throws Throwable
- Overrides:
finalize
in class Object
- Throws:
Throwable
deleteTempFile
private void deleteTempFile()
- Delete the temp file if it exists and we know that
only one stream is reading from it.