private static byte[] b(String string) {
return string.getBytes(UTF_8);
}
private static ByteBuf encode(byte[]... entries) throws Exception {
Encoder encoder = new Encoder();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
for (int ix = 0; ix < entries.length;) {
byte[] key = entries[ix++];
byte[] value = entries[ix++];
encoder.encodeHeader(stream, key, value, false);
}
return Unpooled.wrappedBuffer(stream.toByteArray());
}