public final class FileInputStreamCache extends InputStream implements StreamCache
StreamCache for FilesDEFAULT_SPOOL_THRESHOLD| Constructor and Description |
|---|
FileInputStreamCache(File file) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
StreamCache |
copy()
Create a copy of the stream.
|
protected InputStream |
getInputStream() |
boolean |
inMemory()
Whether this
StreamCache is in memory only or
spooled to persistent storage such as files. |
long |
length()
Gets the length of the cached stream.
|
int |
read() |
void |
reset()
Resets the StreamCache for a new stream consumption.
|
void |
writeTo(OutputStream os)
Writes the stream to the given output
|
mark, markSupported, read, read, skippublic FileInputStreamCache(File file) throws FileNotFoundException
FileNotFoundExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in class InputStreampublic void reset()
StreamCachereset in interface StreamCachereset in class InputStreampublic void writeTo(OutputStream os) throws IOException
StreamCachewriteTo in interface StreamCacheos - the destination to write toIOException - is thrown if write failspublic StreamCache copy() throws IOException
StreamCachecopy in interface StreamCacheIOException - is thrown if the copy failspublic boolean inMemory()
StreamCacheStreamCache is in memory only or
spooled to persistent storage such as files.inMemory in interface StreamCachepublic long length()
StreamCachelength in interface StreamCachepublic int available()
throws IOException
available in class InputStreamIOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionprotected InputStream getInputStream() throws IOException
IOExceptionApache Camel