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
AStreamCache
forFile
s
-
-
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 int
available()
void
close()
org.apache.camel.StreamCache
copy(org.apache.camel.Exchange exchange)
protected InputStream
getInputStream()
boolean
inMemory()
long
length()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
byte[]
readAllBytes()
int
readNBytes(byte[] b, int off, int len)
byte[]
readNBytes(int len)
void
reset()
long
skip(long n)
long
transferTo(OutputStream out)
void
writeTo(OutputStream os)
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream
-
-
-
-
Constructor Detail
-
FileInputStreamCache
public FileInputStreamCache(File file) throws FileNotFoundException
Only for testing purposes.- Throws:
FileNotFoundException
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
-
reset
public void reset()
- Specified by:
reset
in interfaceorg.apache.camel.StreamCache
- Overrides:
reset
in classInputStream
-
writeTo
public void writeTo(OutputStream os) throws IOException
- Specified by:
writeTo
in interfaceorg.apache.camel.StreamCache
- Throws:
IOException
-
copy
public org.apache.camel.StreamCache copy(org.apache.camel.Exchange exchange) throws IOException
- Specified by:
copy
in interfaceorg.apache.camel.StreamCache
- Throws:
IOException
-
inMemory
public boolean inMemory()
- Specified by:
inMemory
in interfaceorg.apache.camel.StreamCache
-
length
public long length()
- Specified by:
length
in interfaceorg.apache.camel.StreamCache
-
available
public int available() throws IOException
- Overrides:
available
in classInputStream
- Throws:
IOException
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
readAllBytes
public byte[] readAllBytes() throws IOException
- Overrides:
readAllBytes
in classInputStream
- Throws:
IOException
-
readNBytes
public byte[] readNBytes(int len) throws IOException
- Overrides:
readNBytes
in classInputStream
- Throws:
IOException
-
readNBytes
public int readNBytes(byte[] b, int off, int len) throws IOException
- Overrides:
readNBytes
in classInputStream
- Throws:
IOException
-
transferTo
public long transferTo(OutputStream out) throws IOException
- Overrides:
transferTo
in classInputStream
- Throws:
IOException
-
getInputStream
protected InputStream getInputStream() throws IOException
- Throws:
IOException
-
-