public final class StreamSourceCache extends StreamSource implements StreamCache
StreamCache
for StreamSource
sFEATURE
DEFAULT_SPOOL_THRESHOLD
Constructor and Description |
---|
StreamSourceCache(StreamCache streamCache) |
StreamSourceCache(StreamSource source,
Exchange exchange) |
Modifier and Type | Method and Description |
---|---|
StreamCache |
copy(Exchange exchange)
Create a copy of the stream.
|
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.
|
void |
reset()
Resets the StreamCache for a new stream consumption.
|
void |
writeTo(OutputStream os)
Writes the stream to the given output
|
getInputStream, getPublicId, getReader, getSystemId, setInputStream, setPublicId, setReader, setSystemId, setSystemId
public StreamSourceCache(StreamSource source, Exchange exchange) throws IOException
IOException
public StreamSourceCache(StreamCache streamCache)
public void reset()
StreamCache
reset
in interface StreamCache
public void writeTo(OutputStream os) throws IOException
StreamCache
writeTo
in interface StreamCache
os
- the destination to write toIOException
- is thrown if write failspublic StreamCache copy(Exchange exchange) throws IOException
StreamCache
copy
in interface StreamCache
exchange
- exchange in which the stream cache object is used;
can be used to delete resources of the stream cache when the exchange is completedIOException
- is thrown if the copy failspublic boolean inMemory()
StreamCache
StreamCache
is in memory only or
spooled to persistent storage such as files.inMemory
in interface StreamCache
public long length()
StreamCache
length
in interface StreamCache
Apache Camel