Package org.apache.http.message
Class BufferedHeader
java.lang.Object
org.apache.http.message.BufferedHeader
- All Implemented Interfaces:
Serializable
,Cloneable
,FormattedHeader
,Header
This class represents a raw HTTP header whose content is parsed 'on demand'
only when the header value needs to be consumed.
- Since:
- 4.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
BufferedHeader
Creates a new header from a buffer. The name of the header will be parsed immediately, the value only if it is accessed.- Parameters:
buffer
- the buffer containing the header to represent- Throws:
ParseException
- in case of a parse error
-
-
Method Details
-
getName
Description copied from interface:Header
Get the name of the Header. -
getValue
Description copied from interface:Header
Get the value of the Header. -
getElements
Description copied from interface:Header
Parses the value.- Specified by:
getElements
in interfaceHeader
- Returns:
- an array of
HeaderElement
entries, may be empty, but is nevernull
- Throws:
ParseException
- in case of a parsing error
-
getValuePos
public int getValuePos()Description copied from interface:FormattedHeader
Obtains the start of the header value in thebuffer
. By accessing the value in the buffer, creation of a temporary string can be avoided.- Specified by:
getValuePos
in interfaceFormattedHeader
- Returns:
- index of the first character of the header value
in the buffer returned by
getBuffer
.
-
getBuffer
Description copied from interface:FormattedHeader
Obtains the buffer with the formatted header. The returned buffer MUST NOT be modified.- Specified by:
getBuffer
in interfaceFormattedHeader
- Returns:
- the formatted header, in a buffer that must not be modified
-
toString
-
clone
- Throws:
CloneNotSupportedException
-