rabbit.httpio
Class ChunkHandler

java.lang.Object
  extended by rabbit.httpio.ChunkHandler

public class ChunkHandler
extends Object

The chunk handler gets raw data buffers and passes the de-chunked content to the listener.

Author:
Robert Olofsson

Constructor Summary
ChunkHandler(ChunkDataFeeder feeder, boolean strictHttp)
          Create a new ChunkHandler that will get data from the given feeder.
 
Method Summary
 long getTotalRead()
          Get the total number of chunk block data bytes read
 void handleData(BufferHandle bufHandle)
          Try to parse and handle the new data
 void setBlockListener(BlockListener listener)
          Set the chunk block listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChunkHandler

public ChunkHandler(ChunkDataFeeder feeder,
                    boolean strictHttp)
Create a new ChunkHandler that will get data from the given feeder.

Parameters:
feeder - the raw data provider
strictHttp - if true then parse http strict, that is use \r\n for line breaks.
Method Detail

setBlockListener

public void setBlockListener(BlockListener listener)
Set the chunk block listener.

Parameters:
listener - the listener for the chunk data

getTotalRead

public long getTotalRead()
Get the total number of chunk block data bytes read

Returns:
the number of chunk data bytes read

handleData

public void handleData(BufferHandle bufHandle)
Try to parse and handle the new data

Parameters:
bufHandle - the data to parse