public class TempFileInputStream
extends org.apache.commons.io.input.AutoCloseInputStream
This class does not support mark/reset. It is always to be wrapped using a BufferedInputStream.
in| Constructor and Description |
|---|
TempFileInputStream(File file,
boolean delayedResourceCleanup)
Construct a new temporary file input stream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
void |
deleteFile() |
File |
getFile() |
void |
mark(int readlimit)
This method does nothing.
|
boolean |
markSupported()
Check whether mark and reset are supported.
|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
static long |
writeToFileAndClose(InputStream in,
File file)
Copy the data to a file and close the input stream afterwards.
|
public TempFileInputStream(File file, boolean delayedResourceCleanup) throws FileNotFoundException
deleteFile().
Deleting is only attempted once.file - the temporary filedelayedResourceCleanup - FileNotFoundExceptionpublic static long writeToFileAndClose(InputStream in, File file) throws IOException
in - the input streamfile - the target fileIOExceptionpublic File getFile()
public void deleteFile()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class org.apache.commons.io.input.AutoCloseInputStreamIOExceptionpublic int available()
throws IOException
available in class org.apache.commons.io.input.ProxyInputStreamIOExceptionpublic void mark(int readlimit)
mark in class org.apache.commons.io.input.ProxyInputStreampublic boolean markSupported()
markSupported in class org.apache.commons.io.input.ProxyInputStreampublic long skip(long n)
throws IOException
skip in class org.apache.commons.io.input.ProxyInputStreamIOExceptionpublic void reset()
throws IOException
reset in class org.apache.commons.io.input.ProxyInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class org.apache.commons.io.input.ProxyInputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class org.apache.commons.io.input.ProxyInputStreamIOExceptionpublic int read()
throws IOException
read in class org.apache.commons.io.input.ProxyInputStreamIOExceptionCopyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.