buf.writeByte(HttpTokens.CR);
buf.writeByte(HttpTokens.LF);
buf.writeByte(HttpTokens.CR);
buf.writeByte(HttpTokens.LF);
HttpHeaderDecoder decoder = new HttpHeaderDecoder(new HashSet<HttpHeaderName>() {
private static final long serialVersionUID = 1L;
{
add(HttpHeaderNames.CONTENT_LENGTH);
add(HttpHeaderNames.ACCEPT);
}
}, 4000);
HttpHeaderContainer headers = new HttpHeaderContainer();
decoder.decode(buf, headers);
assertThat(headers.getHeaders(HttpHeaderNames.CONTENT_LENGTH).get(0), is(new MutableString("0")));
assertThat(headers.getHeaders(HttpHeaderNames.CONTENT_LENGTH).get(1), is(new MutableString("4")));
assertThat(headers.getHeader(HttpHeaderNames.ACCEPT), is(new MutableString("stuff")));