ByteBuffer originalPayload = null;
if( payload!=null )
{
originalPayload = payload.duplicate();
}
_protocolTracer.sentFrame(new TransportFrame(channel, (FrameBody) frameBody, Binary.create(originalPayload)));
}
int payloadSize = Math.min(payload == null ? 0 : payload.remaining(), _maxFrameSize - (buffer.position() - oldPosition));
if(payloadSize > 0)
{