private ByteBuffer endStream(FrameType frameType, int streamId) {
        ByteBuffer endBuffer = ByteBuffer.allocate(Http2.FRAME_HEADER_LENGTH);
        endBuffer.put((byte) 0);
        endBuffer.put((byte) 0);
        endBuffer.put((byte) 0);
        endBuffer.put((byte) (frameType.get() & 0xff));
        endBuffer.put((byte) (Http2.FLAG_END_STREAM & 0xff));
        endBuffer.putInt(streamId & 0x7fffffff);
        endBuffer.flip();
        return endBuffer;
    }
Decodes HTTP2 request and response packets.

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