ByteBuf headerBlock = Unpooled.buffer();
writeLengthField(version, headerBlock, numHeaders);
for (String name: names) {
byte[] nameBytes = name.getBytes(CharsetUtil.UTF_8);
writeLengthField(version, headerBlock, nameBytes.length);
headerBlock.writeBytes(nameBytes);
int savedIndex = headerBlock.writerIndex();
int valueLength = 0;
writeLengthField(version, headerBlock, valueLength);
for (String value: headerFrame.headers().getAll(name)) {
byte[] valueBytes = value.getBytes(CharsetUtil.UTF_8);