public class TempFileInputStream
extends AutoCloseInputStream
This class does not support mark/reset. It is always to be wrapped using a BufferedInputStream.
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
- FileNotFoundException
public static long writeToFileAndClose(InputStream in, File file) throws IOException
in
- the input streamfile
- the target fileIOException
public File getFile()
public void deleteFile()
public void close() throws IOException
IOException
public int available() throws IOException
IOException
public void mark(int readlimit)
public boolean markSupported()
public long skip(long n) throws IOException
IOException
public void reset() throws IOException
IOException
public int read(byte[] b, int off, int len) throws IOException
IOException
public int read(byte[] b) throws IOException
IOException
public int read() throws IOException
IOException
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"