private static void RoundTrip(HpackHuffmanEncoder encoder, byte[] buf) { var buffer = Unpooled.Buffer(); try { encoder.Encode(buffer, new AsciiString(buf, false)); byte[] bytes = new byte[buffer.ReadableBytes]; buffer.ReadBytes(bytes); byte[] actualBytes = Decode(bytes); Assert.Equal(buf, actualBytes); } finally { buffer.Release(); } }
private static void RoundTrip(HpackHuffmanEncoder encoder, string s) { RoundTrip(encoder, Encoding.UTF8.GetBytes(s)); }