}
@Override
public ByteBuffer generate(ControlFrame frame)
{
RstStreamFrame rstStream = (RstStreamFrame)frame;
int frameBodyLength = 8;
int totalLength = ControlFrame.HEADER_LENGTH + frameBodyLength;
ByteBuffer buffer = getByteBufferPool().acquire(totalLength, Generator.useDirectBuffers);
BufferUtil.clearToFill(buffer);
generateControlFrameHeader(rstStream, frameBodyLength, buffer);
buffer.putInt(rstStream.getStreamId() & 0x7F_FF_FF_FF);
buffer.putInt(rstStream.getStatusCode());
buffer.flip();
return buffer;
}