use of com.webpieces.http2.api.dto.lowlevel.lib.AbstractHttp2Frame in project webpieces by deanhiller.
the class DataMarshaller method unmarshal.
@Override
public AbstractHttp2Frame unmarshal(Http2MementoImpl state, DataWrapper framePayloadData) {
DataFrame frame = new DataFrame();
super.unmarshalFrame(state, frame);
byte flags = state.getFrameHeaderData().getFlagsByte();
frame.setEndOfStream((flags & 0x1) == 0x1);
boolean isPadded = (flags & 0x8) == 0x8;
DataSplit split = PaddingUtil.extractPayloadAndPadding(isPadded, framePayloadData, frame.getStreamId());
frame.setData(split.getPayload());
frame.setPadding(split.getPadding());
if (frame.getStreamId() == 0)
throw new ConnectionException(CancelReasonCode.INVALID_STREAM_ID, frame.getStreamId(), "headers frame had invalid stream id=" + frame.getStreamId());
return frame;
}
Aggregations