private int GetMaxSize(int maxPayloadBytes) { if (!Method.HasContent) { return(Framing.Method.FrameSize + Method.GetRequiredBufferSize()); } return(Framing.Method.FrameSize + Method.GetRequiredBufferSize() + Framing.Header.FrameSize + Header.GetRequiredPayloadBufferSize() + Framing.BodySegment.FrameSize * GetBodyFrameCount(maxPayloadBytes) + Body.Length); }
internal override int GetMinimumPayloadBufferSize() { // class id (2 bytes) + method id (2 bytes) + arguments (X bytes) return(4 + _method.GetRequiredBufferSize()); }