private void encodeResponseData(HttpResponseChain chain, ByteBuffer buffer) throws IOException {
        byte[] data = Arrays.copyOfRange(buffer.array(), buffer.position(), buffer.limit());
        HttpResponse response = chain.response();
        sendDataFrame(chain, data, response.clientHttp2Settings(), response.streamId(),
                response.responseStreamEnd());
    }
Encodes HTTP2 request and response packets.

@author Megatron King
@since 2019/1/5 14:24
netbare-core/src/main/java/com/github/megatronking/netbare/http2/Http2EncodeInterceptor.java