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
AByteBufwhich is exposed as anInputStreamwhich makes it very easy to use by Camel and other Camel components. Also supported isStreamCachewhich 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.StreamCachecopy(org.apache.camel.Exchange exchange)booleaninMemory()longlength()booleanmarkSupported()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, transferTo
-
-
-
-
Method Detail
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
reset
public void reset()
- Specified by:
resetin interfaceorg.apache.camel.StreamCache- Overrides:
resetin classInputStream
-
writeTo
public void writeTo(OutputStream os) throws IOException
- Specified by:
writeToin interfaceorg.apache.camel.StreamCache- Throws:
IOException
-
copy
public org.apache.camel.StreamCache copy(org.apache.camel.Exchange exchange) throws IOException- Specified by:
copyin interfaceorg.apache.camel.StreamCache- Throws:
IOException
-
inMemory
public boolean inMemory()
- Specified by:
inMemoryin interfaceorg.apache.camel.StreamCache
-
length
public long length()
- Specified by:
lengthin interfaceorg.apache.camel.StreamCache
-
release
public void release()
Release the buffer when we are done using it.
-
-