internal static ByteString Concat(this ByteString left, ByteString right) { if ((right?.Length).GetValueOrDefault(0) == 0) { return(left); } if ((left?.Length).GetValueOrDefault(0) == 0) { return(right); } var buffer = new byte[left.Length + right.Length]; left.CopyTo(buffer, 0); right.CopyTo(buffer, left.Length); return(ByteString.CopyFrom(buffer)); }