net.sf.jbaobab.io.impl
Class RoughHttpProtocol

java.lang.Object
  extended by net.sf.jbaobab.io.AbstractSeperator
      extended by net.sf.jbaobab.io.impl.RoughHttpProtocol
All Implemented Interfaces:
Protocol<RoughHttpPacket>, Seperator, Translator<RoughHttpPacket>

public class RoughHttpProtocol
extends AbstractSeperator
implements Protocol<RoughHttpPacket>

A Protocol that implements HTTP/1.0 very roughly.

Author:
Oakyoon Cha
See Also:
RoughHttpPacket

Field Summary
protected static byte[] CONTENT_LENGTH_ARRAY
           
protected  int contentLength
           
protected static byte[] HEADER_SEPERATOR_ARRAY
           
protected  String headerEncoding
           
protected  int headerLength
           
protected static byte[] LINE_SEPERATOR_ARRAY
           
 
Constructor Summary
RoughHttpProtocol()
           
RoughHttpProtocol(String headerEncoding)
           
 
Method Summary
protected static int contentLength(ByteBuffer buffer, int headerLength)
           
 boolean ready(ByteBuffer source)
           
 RoughHttpPacket translate(ByteBuffer buffer)
           
 ByteBuffer translate(RoughHttpPacket packet)
           
 
Methods inherited from class net.sf.jbaobab.io.AbstractSeperator
cursor, cursor, seperate, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jbaobab.io.Seperator
seperate, terminate
 

Field Detail

HEADER_SEPERATOR_ARRAY

protected static final byte[] HEADER_SEPERATOR_ARRAY

LINE_SEPERATOR_ARRAY

protected static final byte[] LINE_SEPERATOR_ARRAY

CONTENT_LENGTH_ARRAY

protected static final byte[] CONTENT_LENGTH_ARRAY

headerEncoding

protected String headerEncoding

headerLength

protected int headerLength

contentLength

protected int contentLength
Constructor Detail

RoughHttpProtocol

public RoughHttpProtocol(String headerEncoding)

RoughHttpProtocol

public RoughHttpProtocol()
Method Detail

contentLength

protected static int contentLength(ByteBuffer buffer,
                                   int headerLength)

ready

public boolean ready(ByteBuffer source)
Specified by:
ready in interface Seperator

translate

public RoughHttpPacket translate(ByteBuffer buffer)
Specified by:
translate in interface Translator<RoughHttpPacket>

translate

public ByteBuffer translate(RoughHttpPacket packet)
Specified by:
translate in interface Translator<RoughHttpPacket>