Search in sources :

Example 6 with CharArrayBuffer

use of org.apache.http.util.CharArrayBuffer in project robovm by robovm.

the class BasicLineFormatter method formatRequestLine.

// non-javadoc, see interface LineFormatter
public CharArrayBuffer formatRequestLine(CharArrayBuffer buffer, RequestLine reqline) {
    if (reqline == null) {
        throw new IllegalArgumentException("Request line may not be null");
    }
    CharArrayBuffer result = initBuffer(buffer);
    doFormatRequestLine(result, reqline);
    return result;
}
Also used : CharArrayBuffer(org.apache.http.util.CharArrayBuffer)

Example 7 with CharArrayBuffer

use of org.apache.http.util.CharArrayBuffer in project robovm by robovm.

the class BasicLineParser method parseProtocolVersion.

public static final ProtocolVersion parseProtocolVersion(String value, LineParser parser) throws ParseException {
    if (value == null) {
        throw new IllegalArgumentException("Value to parse may not be null.");
    }
    if (parser == null)
        parser = BasicLineParser.DEFAULT;
    CharArrayBuffer buffer = new CharArrayBuffer(value.length());
    buffer.append(value);
    ParserCursor cursor = new ParserCursor(0, value.length());
    return parser.parseProtocolVersion(buffer, cursor);
}
Also used : CharArrayBuffer(org.apache.http.util.CharArrayBuffer)

Example 8 with CharArrayBuffer

use of org.apache.http.util.CharArrayBuffer in project robovm by robovm.

the class ParserCursor method toString.

public String toString() {
    CharArrayBuffer buffer = new CharArrayBuffer(16);
    buffer.append('[');
    buffer.append(Integer.toString(this.lowerBound));
    buffer.append('>');
    buffer.append(Integer.toString(this.pos));
    buffer.append('>');
    buffer.append(Integer.toString(this.upperBound));
    buffer.append(']');
    return buffer.toString();
}
Also used : CharArrayBuffer(org.apache.http.util.CharArrayBuffer)

Example 9 with CharArrayBuffer

use of org.apache.http.util.CharArrayBuffer in project robovm by robovm.

the class AbstractSessionInputBuffer method readLine.

public String readLine() throws IOException {
    CharArrayBuffer charbuffer = new CharArrayBuffer(64);
    int l = readLine(charbuffer);
    if (l != -1) {
        return charbuffer.toString();
    } else {
        return null;
    }
}
Also used : CharArrayBuffer(org.apache.http.util.CharArrayBuffer)

Example 10 with CharArrayBuffer

use of org.apache.http.util.CharArrayBuffer in project robovm by robovm.

the class BasicHeaderValueFormatter method formatHeaderElement.

// non-javadoc, see interface HeaderValueFormatter
public CharArrayBuffer formatHeaderElement(CharArrayBuffer buffer, final HeaderElement elem, final boolean quote) {
    if (elem == null) {
        throw new IllegalArgumentException("Header element must not be null.");
    }
    int len = estimateHeaderElementLen(elem);
    if (buffer == null) {
        buffer = new CharArrayBuffer(len);
    } else {
        buffer.ensureCapacity(len);
    }
    buffer.append(elem.getName());
    final String value = elem.getValue();
    if (value != null) {
        buffer.append('=');
        doFormatValue(buffer, value, quote);
    }
    final int parcnt = elem.getParameterCount();
    if (parcnt > 0) {
        for (int i = 0; i < parcnt; i++) {
            buffer.append("; ");
            formatNameValuePair(buffer, elem.getParameter(i), quote);
        }
    }
    return buffer;
}
Also used : CharArrayBuffer(org.apache.http.util.CharArrayBuffer)

Aggregations

CharArrayBuffer (org.apache.http.util.CharArrayBuffer)126 BufferedHeader (org.apache.http.message.BufferedHeader)27 FormattedHeader (org.apache.http.FormattedHeader)24 Header (org.apache.http.Header)21 ArrayList (java.util.ArrayList)19 ClientCookie (org.apache.http.cookie.ClientCookie)12 Cookie (org.apache.http.cookie.Cookie)12 ParserCursor (org.apache.http.message.ParserCursor)11 Headers (android.net.http.Headers)6 IOException (java.io.IOException)6 MalformedChallengeException (org.apache.http.auth.MalformedChallengeException)6 MalformedCookieException (org.apache.http.cookie.MalformedCookieException)6 AuthenticationException (org.apache.http.auth.AuthenticationException)5 InvalidCredentialsException (org.apache.http.auth.InvalidCredentialsException)5 BasicNameValuePair (org.apache.http.message.BasicNameValuePair)5 NTCredentials (org.apache.http.auth.NTCredentials)4 HashMap (java.util.HashMap)3 HeaderElement (org.apache.http.HeaderElement)3 NoHttpResponseException (org.apache.http.NoHttpResponseException)3 ParseException (org.apache.http.ParseException)3