Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public class

BufferedHeader

extends Object
implements Cloneable FormattedHeader
java.lang.Object
   ↳ org.apache.http.message.BufferedHeader

Class Overview

This class represents a raw HTTP header whose content is parsed 'on demand' only when the header value needs to be consumed.

Summary

Public Constructors
BufferedHeader ( CharArrayBuffer buffer)
Creates a new header from a buffer.
Public Methods
Object clone ()
Creates and returns a copy of this Object .
CharArrayBuffer getBuffer ()
Obtains the buffer with the formatted header.
HeaderElement[] getElements ()
String getName ()
String getValue ()
int getValuePos ()
Obtains the start of the header value in the buffer .
String toString ()
Returns a string containing a concise, human-readable description of this object.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.FormattedHeader
From interface org.apache.http.Header

Public Constructors

public BufferedHeader ( CharArrayBuffer buffer)

Added in API level 1

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

Public Methods

public Object clone ()

Added in API level 1

Creates and returns a copy of this Object . The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should call super.clone() to create the new instance and then create deep copies of the nested, mutable objects.

Returns
  • a copy of this object.

public CharArrayBuffer getBuffer ()

Added in API level 1

Obtains the buffer with the formatted header. The returned buffer MUST NOT be modified.

Returns
  • the formatted header, in a buffer that must not be modified

public HeaderElement[] getElements ()

Added in API level 1

public String getName ()

Added in API level 1

public String getValue ()

Added in API level 1

public int getValuePos ()

Added in API level 1

Obtains the start of the header value in the buffer . By accessing the value in the buffer, creation of a temporary string can be avoided.

Returns
  • index of the first character of the header value in the buffer returned by getBuffer .

public String toString ()

Added in API level 1

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

          getClass().getName() + '@' + Integer.toHexString(hashCode())
         

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.