org.apache.camel.component.netty.http
Class NettyChannelBufferStreamCache

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.camel.component.netty.http.NettyChannelBufferStreamCache
All Implemented Interfaces:
Closeable, org.apache.camel.StreamCache

public final class NettyChannelBufferStreamCache
extends InputStream
implements org.apache.camel.StreamCache

A ChannelBuffer 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
NettyChannelBufferStreamCache(org.jboss.netty.buffer.ChannelBuffer buffer)
           
 
Method Summary
 boolean inMemory()
           
 long length()
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 void writeTo(OutputStream os)
           
 
Methods inherited from class java.io.InputStream
available, close, mark, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NettyChannelBufferStreamCache

public NettyChannelBufferStreamCache(org.jboss.netty.buffer.ChannelBuffer buffer)
Method Detail

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

reset

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

writeTo

public void writeTo(OutputStream os)
             throws IOException
Specified by:
writeTo 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


Apache Camel