Java 类org.apache.http.FormattedHeader 实例源码

项目:lams    文件:BasicHeaderElementIterator.java   
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;
            }
        }
    }
}
项目:lams    文件:BasicLineFormatter.java   
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;

}
项目:MAKEYOURFACE    文件:BasicHeaderElementIterator.java   
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;
            }
        }
    }
}
项目:MAKEYOURFACE    文件:BasicLineFormatter.java   
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;

}
项目:remote-files-sync    文件:BasicLineFormatterHC4.java   
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;

}
项目:Visit    文件:BasicLineFormatterHC4.java   
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;

}
项目:ZTLib    文件:BasicLineFormatterHC4.java   
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;

}