public class ByteArrayInputStreamCache extends FilterInputStream implements StreamCache
inDEFAULT_SPOOL_THRESHOLD| Constructor and Description |
|---|
ByteArrayInputStreamCache(ByteArrayInputStream in) |
| 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
|
available, close, mark, markSupported, read, read, read, skippublic ByteArrayInputStreamCache(ByteArrayInputStream in)
public void reset()
StreamCachereset in interface StreamCachereset in class FilterInputStreampublic void writeTo(OutputStream os) throws IOException
StreamCachewriteTo in interface StreamCacheos - the destination to write toIOException - is thrown if write failspublic StreamCache copy(Exchange exchange) throws IOException
StreamCachecopy in interface StreamCacheexchange - 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()
StreamCacheStreamCache is in memory only or
spooled to persistent storage such as files.inMemory in interface StreamCachepublic long length()
StreamCachelength in interface StreamCacheCopyright © 2007–2016 The Apache Software Foundation. All rights reserved.