code: private static void encodeHeader(CharSequence name, CharSequence value, ByteBuf buf) {
          final int nameLen = name.length();
          final int valueLen = value.length();
          final int entryLen = nameLen + valueLen + 4;
          buf.ensureWritable(entryLen);
          int offset = buf.writerIndex();
          writeAscii(buf, offset, name, nameLen);
          offset += nameLen;
          buf.setByte(offset++, ':');
          buf.setByte(offset++, ' ');
          writeAscii(buf, offset, value, valueLen);
          offset += valueLen;
          buf.setByte(offset++, '\r');
          buf.setByte(offset++, '\n');
          buf.writerIndex(offset);
      }
docs: Copied from io.netty.handler.codec.http.HttpHeadersEncoder