Class NettyChannelBufferStreamCache
java.lang.Object
java.io.InputStream
org.apache.camel.component.netty.http.NettyChannelBufferStreamCache
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.camel.StreamCache
public final class NettyChannelBufferStreamCache
extends InputStream
implements org.apache.camel.StreamCache
A
ByteBuf which is exposed as an InputStream which makes it very easy to use by Camel and other Camel
components. Also supported is StreamCache which allows the data to be re-read for example when doing content
based routing with XPath.
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 interface org.apache.camel.StreamCache
DEFAULT_SPOOL_THRESHOLD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.StreamCachecopy(org.apache.camel.Exchange exchange) booleaninMemory()longlength()booleanlongposition()intread()intread(byte[] b) intread(byte[] b, int off, int len) voidrelease()Release the buffer when we are done using it.voidreset()voidwriteTo(OutputStream os) Methods inherited from class java.io.InputStream
available, close, mark, nullInputStream, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo
-
Constructor Details
-
NettyChannelBufferStreamCache
public NettyChannelBufferStreamCache(io.netty.buffer.ByteBuf buffer)
-
-
Method Details
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
read
public int read()- Specified by:
readin classInputStream
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) - Overrides:
readin classInputStream
-
reset
public void reset()- Specified by:
resetin interfaceorg.apache.camel.StreamCache- Overrides:
resetin classInputStream
-
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
-
release
public void release()Release the buffer when we are done using it.
-