Class InputStreamCache
java.lang.Object
java.io.InputStream
java.io.ByteArrayInputStream
org.apache.camel.converter.stream.InputStreamCache
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.camel.StreamCache
public final class InputStreamCache
extends ByteArrayInputStream
implements org.apache.camel.StreamCache
A
StreamCache for caching using an in-memory byte array.
Important: All the classes from the Camel release that implements StreamCache is NOT intended for end
users to create as instances, but they are part of Camels
stream-caching functionality.-
Field Summary
Fields inherited from class java.io.ByteArrayInputStream
buf, count, mark, posFields inherited from interface org.apache.camel.StreamCache
DEFAULT_SPOOL_THRESHOLD -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.ByteArrayInputStream
available, close, mark, markSupported, read, read, readAllBytes, readNBytes, reset, skip, transferToMethods inherited from class java.io.InputStream
nullInputStream, read, readNBytes, skipNBytesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.StreamCache
reset
-
Constructor Details
-
InputStreamCache
public InputStreamCache(byte[] data) -
InputStreamCache
public InputStreamCache(byte[] data, int count)
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceorg.apache.camel.StreamCache- Throws:
IOException
-
copy
public org.apache.camel.StreamCache copy(org.apache.camel.Exchange exchange) - Specified by:
copyin interfaceorg.apache.camel.StreamCache
-
inMemory
public boolean inMemory()- Specified by:
inMemoryin interfaceorg.apache.camel.StreamCache
-
length
public long length()- Specified by:
lengthin interfaceorg.apache.camel.StreamCache
-
position
public long position()- Specified by:
positionin interfaceorg.apache.camel.StreamCache
-