This modification of Heinzi's answer also works:
var usefulBuffer = RecvBuffer2.TakeWhile(x => x != 0).ToArray();