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.-
Field Summary
Fields inherited from interface org.apache.camel.StreamCache
DEFAULT_SPOOL_THRESHOLD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.StreamCache
copy
(org.apache.camel.Exchange exchange) boolean
inMemory()
long
length()
boolean
int
read()
int
read
(byte[] b) int
read
(byte[] b, int off, int len) void
release()
Release the buffer when we are done using it.void
reset()
void
writeTo
(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:
markSupported
in classInputStream
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
reset
public void reset()- Specified by:
reset
in interfaceorg.apache.camel.StreamCache
- Overrides:
reset
in classInputStream
-
writeTo
- Specified by:
writeTo
in interfaceorg.apache.camel.StreamCache
- Throws:
IOException
-
copy
- Specified by:
copy
in interfaceorg.apache.camel.StreamCache
- Throws:
IOException
-
inMemory
public boolean inMemory()- Specified by:
inMemory
in interfaceorg.apache.camel.StreamCache
-
length
public long length()- Specified by:
length
in interfaceorg.apache.camel.StreamCache
-
release
public void release()Release the buffer when we are done using it.
-