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;
}
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);
}
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();
}
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;
}
}
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;
}
Aggregations