@Override
public void wrap(DirectBuffer buffer, int offset, int length) {
reset();
headerDecoder.wrap(buffer, offset);
offset += headerDecoder.encodedLength();
decoder.wrap(buffer, offset, headerDecoder.blockLength(), headerDecoder.version());
recordType = decoder.recordType();
requestStreamId = decoder.requestStreamId();
requestId = decoder.requestId();
protocolVersion = decoder.protocolVersion();
valueType = decoder.valueType();
intent = Intent.fromProtocolValue(valueType, decoder.intent());
rejectionType = decoder.rejectionType();
final int rejectionReasonLength = decoder.rejectionReasonLength();
offset += headerDecoder.blockLength();
offset += RecordMetadataDecoder.rejectionReasonHeaderLength();
rejectionReason.wrap(buffer, offset, rejectionReasonLength);
}