public final class SourceCache extends StringSource implements StreamCache
StreamCache
implementation for StringSource
sFEATURE
DEFAULT_SPOOL_THRESHOLD
Constructor and Description |
---|
SourceCache(String data) |
Modifier and Type | Method and Description |
---|---|
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
|
getEncoding, getInputStream, getReader, getText, readExternal, toString, writeExternal
getPublicId, getSystemId, setInputStream, setPublicId, setReader, setSystemId, setSystemId
public SourceCache(String data)
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 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