protected static Buffer encodeKnownHeaders(final MemoryManager memoryManager,
Buffer buffer, final HttpHeader httpHeader) {
// buffer = httpHeader.serializeContentType(memoryManager, buffer);
final CacheableDataChunk name = CacheableDataChunk.create();
final CacheableDataChunk value = CacheableDataChunk.create();
final List<ContentEncoding> packetContentEncodings =
httpHeader.getContentEncodings(true);
final boolean hasContentEncodings = !packetContentEncodings.isEmpty();
if (hasContentEncodings) {
buffer = encodeContentEncodingHeader(memoryManager, buffer,
httpHeader, name, value);
}
name.recycle();
value.recycle();
httpHeader.makeUpgradeHeader();
return buffer;
}