public class ReaderCache extends StringReader implements StreamCache
StreamCache
for String Reader
sDEFAULT_SPOOL_THRESHOLD
Constructor and Description |
---|
ReaderCache(String data) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
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
|
mark, markSupported, read, read, ready, skip
public ReaderCache(String data)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class StringReader
public void reset()
StreamCache
reset
in interface StreamCache
reset
in class StringReader
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