public interface StreamCache
StreamCachingStrategy
for determining if/how to wrap a stream-based message.
The Camel routing engine uses the CamelInternalProcessor.StreamCachingAdvice
to apply the stream cache during routing.
It is recommended in the copy()
method to let the copied stream start from the start. If the implementation
does not support copy, then return null.Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_SPOOL_THRESHOLD |
Modifier and Type | Method and Description |
---|---|
StreamCache |
copy()
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
|
static final long DEFAULT_SPOOL_THRESHOLD
void reset()
void writeTo(OutputStream os) throws IOException
os
- the destination to write toIOException
- is thrown if write failsStreamCache copy() throws IOException
IOException
- is thrown if the copy failsboolean inMemory()
StreamCache
is in memory only or
spooled to persistent storage such as files.long length()
Apache Camel