Class 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.
    • Constructor Detail

      • NettyChannelBufferStreamCache

        public NettyChannelBufferStreamCache​(io.netty.buffer.ByteBuf buffer)
    • Method Detail

      • reset

        public void reset()
        Specified by:
        reset in interface org.apache.camel.StreamCache
        Overrides:
        reset in class InputStream
      • copy

        public org.apache.camel.StreamCache copy​(org.apache.camel.Exchange exchange)
                                          throws IOException
        Specified by:
        copy in interface org.apache.camel.StreamCache
        Throws:
        IOException
      • inMemory

        public boolean inMemory()
        Specified by:
        inMemory in interface org.apache.camel.StreamCache
      • length

        public long length()
        Specified by:
        length in interface org.apache.camel.StreamCache
      • release

        public void release()
        Release the buffer when we are done using it.