use of org.apache.http.message.BufferedHeader in project jmeter by apache.
the class HTTPHC4Impl method writeResponseHeader.
/**
* Write responseHeader to headerBuffer in an optimized way
* @param headerBuffer {@link StringBuilder}
* @param responseHeader {@link Header}
*/
private void writeResponseHeader(StringBuilder headerBuffer, Header responseHeader) {
if (responseHeader instanceof BufferedHeader) {
CharArrayBuffer buffer = ((BufferedHeader) responseHeader).getBuffer();
// $NON-NLS-1$
headerBuffer.append(buffer.buffer(), 0, buffer.length()).append('\n');
} else {
headerBuffer.append(responseHeader.getName()).append(// $NON-NLS-1$
": ").append(responseHeader.getValue()).append(// $NON-NLS-1$
'\n');
}
}
use of org.apache.http.message.BufferedHeader in project platform_external_apache-http by android.
the class RFC2965Spec method getVersionHeader.
@Override
public Header getVersionHeader() {
CharArrayBuffer buffer = new CharArrayBuffer(40);
buffer.append(SM.COOKIE2);
buffer.append(": ");
buffer.append("$Version=");
buffer.append(Integer.toString(getVersion()));
return new BufferedHeader(buffer);
}
Aggregations