TopoWeb Commons API
Class DoubleNewLineDetector

All Implemented Interfaces:

public class DoubleNewLineDetector
extends java.lang.Object
implements RequestBoundaryDetector

Detects if there are two consecutive new lines in the Session bytes read in. New lines are interpreted to be either of the byte strings '\r\n\', or '\n'. This captures the delineation of an HTTP request header (in that case, the '\n\n' check is redundant)

Babak Farhang

Constructor Summary
Method Summary
 boolean requestCompleted(Session session)
          Tests whether enough bytes have been read into the given session to form a request.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public DoubleNewLineDetector()
Method Detail


public boolean requestCompleted(Session session)
Description copied from interface: RequestBoundaryDetector
Tests whether enough bytes have been read into the given session to form a request.

Specified by:
requestCompleted in interface RequestBoundaryDetector
session - the Session inspected
true, if there are enough bytes in the given session to form an interpretable request; false, o.w.
See Also:
Session.getReadArray(), Session.getReadAmount()

TopoWeb Commons API

Copyright (C) 2002 Babak Farhang

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.