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
AByteBuf
which is exposed as anInputStream
which makes it very easy to use by Camel and other Camel components. Also supported isStreamCache
which allows the data to be re-read for example when doing content based routing with XPath.
-
-
Constructor Summary
Constructors Constructor Description NettyChannelBufferStreamCache(io.netty.buffer.ByteBuf buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.StreamCache
copy(org.apache.camel.Exchange exchange)
boolean
inMemory()
long
length()
boolean
markSupported()
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, transferTo
-
-
-
-
Method Detail
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classInputStream
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
reset
public void reset()
- Specified by:
reset
in interfaceorg.apache.camel.StreamCache
- Overrides:
reset
in classInputStream
-
writeTo
public void writeTo(OutputStream os) throws IOException
- Specified by:
writeTo
in interfaceorg.apache.camel.StreamCache
- Throws:
IOException
-
copy
public org.apache.camel.StreamCache copy(org.apache.camel.Exchange exchange) throws IOException
- 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.
-
-