| java.lang.Object org.apache.http.message.BasicLineFormatter
BasicLineFormatter | public class BasicLineFormatter implements LineFormatter(Code) | | Interface for formatting elements of the HEAD section of an HTTP message.
This is the complement to
LineParser .
There are individual methods for formatting a request line, a
status line, or a header line. The formatting does not include the
trailing line break sequence CR-LF.
The formatted lines are returned in memory, the formatter does not depend
on any specific IO mechanism.
Instances of this interface are expected to be stateless and thread-safe.
author: Remy Maucherat author: Mike Bowler author: Jeff Dever author: Oleg Kalnichevski author: and others author: version: $Revision: 574185 $ since: 4.0 |
Field Summary | |
final public static BasicLineFormatter | DEFAULT A default instance of this class, for use as default or fallback. |
Method Summary | |
public CharArrayBuffer | appendProtocolVersion(CharArrayBuffer buffer, ProtocolVersion version) | protected void | doFormatHeader(CharArrayBuffer buffer, Header header) Actually formats a header. | protected void | doFormatRequestLine(CharArrayBuffer buffer, RequestLine reqline) Actually formats a request line. | protected void | doFormatStatusLine(CharArrayBuffer buffer, StatusLine statline) Actually formats a status line. | protected int | estimateProtocolVersionLen(ProtocolVersion version) Guesses the length of a formatted protocol version. | final public static String | formatHeader(Header header, LineFormatter formatter) Formats a header. | public CharArrayBuffer | formatHeader(CharArrayBuffer buffer, Header header) | final public static String | formatProtocolVersion(ProtocolVersion version, LineFormatter formatter) Formats a protocol version. | final public static String | formatRequestLine(RequestLine reqline, LineFormatter formatter) Formats a request line. | public CharArrayBuffer | formatRequestLine(CharArrayBuffer buffer, RequestLine reqline) | final public static String | formatStatusLine(StatusLine statline, LineFormatter formatter) Formats a status line. | public CharArrayBuffer | formatStatusLine(CharArrayBuffer buffer, StatusLine statline) | protected CharArrayBuffer | initBuffer(CharArrayBuffer buffer) Obtains a buffer for formatting. |
DEFAULT | final public static BasicLineFormatter DEFAULT(Code) | | A default instance of this class, for use as default or fallback.
Note that
BasicLineFormatter is not a singleton, there can
be many instances of the class itself and of derived classes.
The instance here provides non-customized, default behavior.
|
estimateProtocolVersionLen | protected int estimateProtocolVersionLen(ProtocolVersion version)(Code) | | Guesses the length of a formatted protocol version.
Needed to guess the length of a formatted request or status line.
Parameters: version - the protocol version to format, or null the estimated length of the formatted protocol version,in characters |
formatProtocolVersion | final public static String formatProtocolVersion(ProtocolVersion version, LineFormatter formatter)(Code) | | Formats a protocol version.
Parameters: version - the protocol version to format Parameters: formatter - the formatter to use, ornull for theBasicLineFormatter.DEFAULT default the formatted protocol version |
initBuffer | protected CharArrayBuffer initBuffer(CharArrayBuffer buffer)(Code) | | Obtains a buffer for formatting.
Parameters: buffer - a buffer already available, or null the cleared argument buffer if there is one, ora new empty buffer that can be used for formatting |
|
|