@Immutable public class BasicLineFormatterHC4 extends java.lang.Object implements org.apache.http.message.LineFormatter
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.| Modifier and Type | Field and Description |
|---|---|
static BasicLineFormatterHC4 |
DEFAULT
Deprecated.
(4.3) use
INSTANCE |
static BasicLineFormatterHC4 |
INSTANCE |
| Constructor and Description |
|---|
BasicLineFormatterHC4() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.util.CharArrayBuffer |
appendProtocolVersion(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.ProtocolVersion version) |
protected void |
doFormatHeader(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.Header header)
Actually formats a header.
|
protected void |
doFormatRequestLine(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.RequestLine reqline)
Actually formats a request line.
|
protected void |
doFormatStatusLine(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.StatusLine statline)
Actually formats a status line.
|
protected int |
estimateProtocolVersionLen(org.apache.http.ProtocolVersion version)
Guesses the length of a formatted protocol version.
|
org.apache.http.util.CharArrayBuffer |
formatHeader(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.Header header) |
static java.lang.String |
formatHeader(org.apache.http.Header header,
org.apache.http.message.LineFormatter formatter)
Formats a header.
|
static java.lang.String |
formatProtocolVersion(org.apache.http.ProtocolVersion version,
org.apache.http.message.LineFormatter formatter)
Formats a protocol version.
|
org.apache.http.util.CharArrayBuffer |
formatRequestLine(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.RequestLine reqline) |
static java.lang.String |
formatRequestLine(org.apache.http.RequestLine reqline,
org.apache.http.message.LineFormatter formatter)
Formats a request line.
|
org.apache.http.util.CharArrayBuffer |
formatStatusLine(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.StatusLine statline) |
static java.lang.String |
formatStatusLine(org.apache.http.StatusLine statline,
org.apache.http.message.LineFormatter formatter)
Formats a status line.
|
protected org.apache.http.util.CharArrayBuffer |
initBuffer(org.apache.http.util.CharArrayBuffer charBuffer)
Obtains a buffer for formatting.
|
@Deprecated public static final BasicLineFormatterHC4 DEFAULT
INSTANCEBasicLineFormatter 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.public static final BasicLineFormatterHC4 INSTANCE
protected org.apache.http.util.CharArrayBuffer initBuffer(org.apache.http.util.CharArrayBuffer charBuffer)
charBuffer - a buffer already available, or nullpublic static java.lang.String formatProtocolVersion(org.apache.http.ProtocolVersion version,
org.apache.http.message.LineFormatter formatter)
version - the protocol version to formatformatter - the formatter to use, or
null for the
defaultpublic org.apache.http.util.CharArrayBuffer appendProtocolVersion(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.ProtocolVersion version)
appendProtocolVersion in interface org.apache.http.message.LineFormatterprotected int estimateProtocolVersionLen(org.apache.http.ProtocolVersion version)
version - the protocol version to format, or nullpublic static java.lang.String formatRequestLine(org.apache.http.RequestLine reqline,
org.apache.http.message.LineFormatter formatter)
reqline - the request line to formatformatter - the formatter to use, or
null for the
defaultpublic org.apache.http.util.CharArrayBuffer formatRequestLine(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.RequestLine reqline)
formatRequestLine in interface org.apache.http.message.LineFormatterprotected void doFormatRequestLine(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.RequestLine reqline)
formatRequestLine(org.apache.http.RequestLine, org.apache.http.message.LineFormatter).buffer - the empty buffer into which to format,
never nullreqline - the request line to format, never nullpublic static java.lang.String formatStatusLine(org.apache.http.StatusLine statline,
org.apache.http.message.LineFormatter formatter)
statline - the status line to formatformatter - the formatter to use, or
null for the
defaultpublic org.apache.http.util.CharArrayBuffer formatStatusLine(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.StatusLine statline)
formatStatusLine in interface org.apache.http.message.LineFormatterprotected void doFormatStatusLine(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.StatusLine statline)
formatStatusLine(org.apache.http.StatusLine, org.apache.http.message.LineFormatter).buffer - the empty buffer into which to format,
never nullstatline - the status line to format, never nullpublic static java.lang.String formatHeader(org.apache.http.Header header,
org.apache.http.message.LineFormatter formatter)
header - the header to formatformatter - the formatter to use, or
null for the
defaultpublic org.apache.http.util.CharArrayBuffer formatHeader(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.Header header)
formatHeader in interface org.apache.http.message.LineFormatterprotected void doFormatHeader(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.Header header)
formatHeader(org.apache.http.Header, org.apache.http.message.LineFormatter).buffer - the empty buffer into which to format,
never nullheader - the header to format, never nullCopyright © 1999-2015 The Apache Software Foundation. All rights reserved.