Need a scenario where would fail Array.ConstrainedCopy()

Posted by Sir Psycho on Stack Overflow See other posts from Stack Overflow or by Sir Psycho
Published on 2010-06-01T12:03:19Z Indexed on 2010/06/01 12:13 UTC
Read the original article Hit count: 126

Filed under:

Hi,

Just playing around with some of the APIs in .NET and I can't seem to find a way to cause Array.ConstrainedCopy() fail.

According to MSDN, it's treated as an atomic operation. If it fails during the copy, the entire call fails resulting in no elements being copied as opposed to its Array.Copy() counterpart.

Can someone demonstrate this or tell me how to do this?

© Stack Overflow or respective owner

Related posts about c#