本文整理汇总了Java中org.apache.http.FormattedHeader类的典型用法代码示例。如果您正苦于以下问题:Java FormattedHeader类的具体用法?Java FormattedHeader怎么用?Java FormattedHeader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FormattedHeader类属于org.apache.http包,在下文中一共展示了FormattedHeader类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bufferHeaderValue
import org.apache.http.FormattedHeader; //导入依赖的package包/类
private void bufferHeaderValue() {
this.cursor = null;
this.buffer = null;
while (this.headerIt.hasNext()) {
Header h = this.headerIt.nextHeader();
if (h instanceof FormattedHeader) {
this.buffer = ((FormattedHeader) h).getBuffer();
this.cursor = new ParserCursor(0, this.buffer.length());
this.cursor.updatePos(((FormattedHeader) h).getValuePos());
break;
} else {
String value = h.getValue();
if (value != null) {
this.buffer = new CharArrayBuffer(value.length());
this.buffer.append(value);
this.cursor = new ParserCursor(0, this.buffer.length());
break;
}
}
}
}
示例2: formatHeader
import org.apache.http.FormattedHeader; //导入依赖的package包/类
public CharArrayBuffer formatHeader(CharArrayBuffer buffer,
Header header) {
if (header == null) {
throw new IllegalArgumentException
("Header may not be null");
}
CharArrayBuffer result = null;
if (header instanceof FormattedHeader) {
// If the header is backed by a buffer, re-use the buffer
result = ((FormattedHeader)header).getBuffer();
} else {
result = initBuffer(buffer);
doFormatHeader(result, header);
}
return result;
}
示例3: formatHeader
import org.apache.http.FormattedHeader; //导入依赖的package包/类
public CharArrayBuffer formatHeader(final CharArrayBuffer buffer,
final Header header) {
Args.notNull(header, "Header");
final CharArrayBuffer result;
if (header instanceof FormattedHeader) {
// If the header is backed by a buffer, re-use the buffer
result = ((FormattedHeader)header).getBuffer();
} else {
result = initBuffer(buffer);
doFormatHeader(result, header);
}
return result;
}