com.atlassian.core.spool
Class SpoolFileInputStream
java.lang.Object
java.io.InputStream
java.io.FileInputStream
com.atlassian.core.spool.SpoolFileInputStream
- All Implemented Interfaces:
- Closeable
public class SpoolFileInputStream
- extends FileInputStream
A FileInputStream that deletes its input file when closed. Useful for transient file spooling.
Because we don't know when a database will have finished using the stream, or if it will close it itself, this class
closes the stream when all the data has been read from it.
|
Method Summary |
void |
close()
|
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
SpoolFileInputStream
public SpoolFileInputStream(File file)
throws FileNotFoundException
- Parameters:
file -
- Throws:
FileNotFoundException
SpoolFileInputStream
public SpoolFileInputStream(String name)
throws FileNotFoundException
- Parameters:
name -
- Throws:
FileNotFoundException
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Overrides:
close in class FileInputStream
- Throws:
IOException
read
public int read()
throws IOException
- Overrides:
read in class FileInputStream
- Throws:
IOException
read
public int read(byte[] b)
throws IOException
- Overrides:
read in class FileInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read in class FileInputStream
- Throws:
IOException
Copyright © 2015 Atlassian. All rights reserved.