org.apache.jackrabbit.core.data.db
Class TempFileInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.commons.io.input.ProxyInputStream
org.apache.commons.io.input.AutoCloseInputStream
org.apache.jackrabbit.core.data.db.TempFileInputStream
- All Implemented Interfaces:
- Closeable
public class TempFileInputStream
- extends org.apache.commons.io.input.AutoCloseInputStream
An input stream from a temporary file. The file is deleted when the stream is
closed, fully read, or garbage collected.
Methods inherited from class org.apache.commons.io.input.AutoCloseInputStream |
finalize |
TempFileInputStream
public TempFileInputStream(File file)
throws FileNotFoundException
- Construct a new temporary file input stream.
The file is deleted if the input stream is closed or fully read.
Deleting is only attempted once.
- Parameters:
file
- the temporary file
- Throws:
FileNotFoundException
writeToFileAndClose
public static long writeToFileAndClose(InputStream in,
File file)
throws IOException
- Copy the data to a file and close the input stream afterwards.
- Parameters:
in
- the input streamfile
- the target file
- Returns:
- the size of the file
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class org.apache.commons.io.input.AutoCloseInputStream
- Throws:
IOException
available
public int available()
throws IOException
- Overrides:
available
in class org.apache.commons.io.input.ProxyInputStream
- Throws:
IOException
mark
public void mark(int readlimit)
- Overrides:
mark
in class org.apache.commons.io.input.ProxyInputStream
markSupported
public boolean markSupported()
- Overrides:
markSupported
in class org.apache.commons.io.input.ProxyInputStream
skip
public long skip(long n)
throws IOException
- Overrides:
skip
in class org.apache.commons.io.input.ProxyInputStream
- Throws:
IOException
reset
public void reset()
throws IOException
- Overrides:
reset
in class org.apache.commons.io.input.ProxyInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class org.apache.commons.io.input.AutoCloseInputStream
- Throws:
IOException
read
public int read(byte[] b)
throws IOException
- Overrides:
read
in class org.apache.commons.io.input.AutoCloseInputStream
- Throws:
IOException
read
public int read()
throws IOException
- Overrides:
read
in class org.apache.commons.io.input.AutoCloseInputStream
- Throws:
IOException
Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.