Class FileInputStreamCache
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.camel.converter.stream.FileInputStreamCache
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.camel.StreamCache
public final class FileInputStreamCache extends InputStream implements org.apache.camel.StreamCache
AStreamCacheforFiles
-
-
Constructor Summary
Constructors Constructor Description FileInputStreamCache(File file)Only for testing purposes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()org.apache.camel.StreamCachecopy(org.apache.camel.Exchange exchange)protected InputStreamgetInputStream()booleaninMemory()longlength()intread()voidreset()voidwriteTo(OutputStream os)-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, skip, transferTo
-
-
-
-
Constructor Detail
-
FileInputStreamCache
public FileInputStreamCache(File file) throws FileNotFoundException
Only for testing purposes.- Throws:
FileNotFoundException
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream
-
reset
public void reset()
- Specified by:
resetin interfaceorg.apache.camel.StreamCache- Overrides:
resetin classInputStream
-
writeTo
public void writeTo(OutputStream os) throws IOException
- Specified by:
writeToin interfaceorg.apache.camel.StreamCache- Throws:
IOException
-
copy
public org.apache.camel.StreamCache copy(org.apache.camel.Exchange exchange) throws IOException- Specified by:
copyin interfaceorg.apache.camel.StreamCache- Throws:
IOException
-
inMemory
public boolean inMemory()
- Specified by:
inMemoryin interfaceorg.apache.camel.StreamCache
-
length
public long length()
- Specified by:
lengthin interfaceorg.apache.camel.StreamCache
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
getInputStream
protected InputStream getInputStream() throws IOException
- Throws:
IOException
-
-