Build 1.0_r1(from source)

org.apache.http.message
Class BufferedHeader

java.lang.Object
  extended by org.apache.http.message.BufferedHeader
All Implemented Interfaces:
Cloneable, FormattedHeader, Header

public class BufferedHeader
extends Object
implements FormattedHeader, Cloneable

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


Constructor Summary
BufferedHeader(CharArrayBuffer buffer)
          Creates a new header from a buffer.
 
Method Summary
 Object clone()
          Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
 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 the receiver.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BufferedHeader

public BufferedHeader(CharArrayBuffer buffer)
               throws ParseException
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 Detail

getName

public String getName()
Specified by:
getName in interface Header

getValue

public String getValue()
Specified by:
getValue in interface Header

getElements

public HeaderElement[] getElements()
                            throws ParseException
Specified by:
getElements in interface Header
Throws:
ParseException

getValuePos

public int getValuePos()
Description copied from interface: FormattedHeader
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.

Specified by:
getValuePos in interface FormattedHeader
Returns:
index of the first character of the header value in the buffer returned by getBuffer.

getBuffer

public CharArrayBuffer getBuffer()
Description copied from interface: FormattedHeader
Obtains the buffer with the formatted header. The returned buffer MUST NOT be modified.

Specified by:
getBuffer in interface FormattedHeader
Returns:
the formatted header, in a buffer that must not be modified

toString

public String toString()
Description copied from class: Object
Returns a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class Object
Returns:
String a printable representation for the receiver.

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from class: Object
Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.

Classes which wish to support cloning must specify that they implement the Cloneable interface, since the implementation checks for this.

Overrides:
clone in class Object
Returns:
Object a shallow copy of this object.
Throws:
CloneNotSupportedException - if the receiver's class does not implement the interface Cloneable.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature