For ENG-5435, failed to flip buffer containing serialized data before co...

...unting how many bytes are being discarded causing permanent backpressure