Alternative for returning an array from a property getter
<p>I'm wondering why Code Analysis (in VS 2012) emits "CA1819: Properties should not return arrays" for the following code:</p>

<pre><code>private byte[] BackingFieldData;

public byte[] Data
{
    get { return this.BackingFieldData; }
    set { this.BackingFieldData = value; }
}
</code></pre>

<p>The description of the warning states <em>Arrays returned by properties are not write-protected, even if the property is read-only. To keep the array tamper-proof, the property must return a copy of the array.</em> </p>

<p>What i want is to return the array. The user should be able to modify the array, but should not be able to resize it. The size of the array is frequently accessed by the user. The user must be able to access the elements by index. Therefore the array type seems to fit perfectly.</p>

<p>Alternates I've considered are <code>IEnumerable&lt;byte&gt;</code> (Indexing is awfully done using <code>Skip</code> and <code>Take</code> etc.), <code>IList&lt;byte&gt;</code> (which focuses on adding and removing elements - I don't want that) and <code>ReadOnlyCollection&lt;byte&gt;</code> (I hate it when classes expose methods which  always throw <code>NotSupportedException</code>s, far away from good coding style IMHO). I also thought about creating a custom Interface with a wrapper class around the array - but what's the point in that (except that I could get rid of the warning without suppressing it).</p>

<p>So, does anyone know about a good type to return instead of an array type or of a good reason why not to return an array in this case? Are there any implications I did not mention so far?</p>
