}
StringEndPoint io=new StringEndPoint();
io.setInput(request);
ByteArrayBuffer buffer= new ByteArrayBuffer(4096);
SimpleBuffers buffers=new SimpleBuffers(new Buffer[]{buffer});
Handler handler = new Handler()
{
/* (non-Javadoc)
* @see org.mortbay.jetty.HttpParserTest.Handler#content(org.mortbay.io.Buffer)
*/
public void content(Buffer ref)
{
super.content(ref);
System.err.println(ref);
}
/* (non-Javadoc)
* @see org.mortbay.jetty.HttpParserTest.Handler#headerComplete()
*/
public void headerComplete()
{
System.err.println("---");
super.headerComplete();
}
/* (non-Javadoc)
* @see org.mortbay.jetty.HttpParserTest.Handler#messageComplete(long)
*/
public void messageComplete(long contentLength)
{
System.err.println("===");
super.messageComplete(contentLength);
}
/* (non-Javadoc)
* @see org.mortbay.jetty.HttpParserTest.Handler#parsedHeader(org.mortbay.io.Buffer, org.mortbay.io.Buffer)
*/
public void parsedHeader(Buffer name, Buffer value)
{
System.err.println(name+": "+value);
super.parsedHeader(name,value);
}
/* (non-Javadoc)
* @see org.mortbay.jetty.HttpParserTest.Handler#startRequest(org.mortbay.io.Buffer, org.mortbay.io.Buffer, org.mortbay.io.Buffer)
*/
public void startRequest(Buffer tok0, Buffer tok1, Buffer tok2)
{
System.err.println(tok0+" "+tok1+" "+tok2);
super.startRequest(tok0,tok1,tok2);
}
};
HttpParser parser= new HttpParser(buffers,io, handler, buffer.capacity(), 0);
parser.parse();
}